The tendency to seek fulfillment of desires in the external world lead to a mix of both pleasure and pain and the fulfillment is only temporary. The actions performed to fulfill our desires create karma and inevitably lead us into bondage. Even though we are never fully satisfied with external fulfillment, the force of habit propels us to continue seeking fulfillment in the external world and thus keeping us enmeshed in the web of karma.
Only through pain, suffering, and disappointment does the soul finally realize the futility of the pursuit of external desires. Living in the world is a necessary consequence of our existence, but the soul realizes its purpose is liberation. As the goal of liberation becomes more primary, the pursuit of worldly desires becomes secondary and we become less attached to the fruits of our actions. Thus we slowly start to extricate ourselves from the cycle of karma and liberation becomes possible. The external tendencies of the mind start to shift inwards and the mind becomes still. Thus starts the path of Yoga.
Every experience in life, whether satisfactory or unsatisfactory creates an opportunity . . . an opportunity to propel ourselves to seek inner knowledge and spiritual wisdom. This inner (or higher knowledge) is different from knowledge of the world. The fire of higher knowledge eventually burns up all of our desires and karmas and leads to liberation. Liberation (Moksha) is the final goal.