It seems odd to think of the practice of yoga as having a "goal" - but, it does.
Kaivalya is defined as "ultimate freedom - complete detachment."
Yoga frees us. Most importantly yoga frees us from the prision of the mind. This is the place were all suffering originates.
When the mind is free of worry, doubt and indecision, free of fear, anger, depression and envy, free of greed, lust, sloth and false pride, then the true Self of our being has a chance to shine through.