For one aspiring to ascend the pedestal of yoga, actional involvement is the means, cause. As he reaches that pedestal, withdrawal becomes the right step.
After explaining sānkhya and yoga in the 2nd chapter, Krishna, in answer to Arjuna’s question (5.1), clarified that sannyāsa and yoga are not to be compared and contrasted. Instead they should be viewed as steps in a ladder, one leading to the other (5.4, 5), and finally to the destination.
The pursuit is one, but has two phases, one follows the other. The seeker has to be immersed in activities, like any other, but with yoga attitude. After gaining maturity and refinement, he can think of leaving activity and being engrossed in spiritual contemplation alone.
Here Krishna holds that the seeker initially should pursue activity with yogic refinement. Gaining maturity in the process, the mind grows indifference to activities.
Performing or not performing activities is not what matters; the focus should be on the mind’s attitude and affinity. These are bound to change as sādhanā advances.