Everything happens as per the laws of Nature, which is at the command of Ishwara.
Purusharth and Pralabdh have their roles but Ishwar kripa or Divine Intervention is supreme. Karma is a part of this world and its activities. It is just a movement within the world something akin to being locked in a room with freedom to walk inside, without possibility of escape. With Karma one moves around whole ‘samsara’, but cannot gain ‘moksha’ or escape the bondage of action.
Even if we know that karma is not supreme, yet we still perform action for some worldly benefit/ happiness. We may not get moksha but can get something from the world. Whatever we get in life – body, environment, happiness and sorrow -- is the result of action. The defect is that the fruit is temporary. The human body we get is short-lived and is dying every second. The period of stay in a particular body depends on the result of its karma. Once the result is exhausted, it automatically departs.
Moreover actions act like speed-breakers; they slow down our progress towards liberation (gati nirodhkam). On the path of ‘moksha’ the attachment to actions and their result is a great obstacle. Obstructed by desires, life goes on and enlightenment is forgotten. In Bhaj Govindam Sankaracharya says, “Life is fleeting, yet one gives up not the winds of desire.” Gita says that one cannot remain even for a second without performing karma (action). The only way to break this cycle is to perform action for a higher cause; without any selfish desire dedicating them to the Lord.
In Gita also Bhagwan advises us to dedicate all actions to Him and do all actions as if they are being done for Him. Such actions then help in subduing the ego, and results in humbling experience. When Hanumanji went to Lanka, he was not afraid in spite of the powerful Ravana, as he had full faith in Rama and had dedicated himself totally to Rama. He knows everything and is all powerful and does the best for us and one cannot question His intelligence and so His doings.
Hence we should work with the attitude & conviction that we belong to Him. He is the master & everything happens as per His wish. The mind thus gets purified and becomes a fit vehicle for liberation and gain the knowledge of Ishwar, the supreme Reality.