“’What is karma, and what isn’t?’ even the experts are confused about this. So, I will explain it to you in an understandable way, to help you get free from all misfortune.” [4.16]
“Karma is a deep, difficult subject. Know that it has three types: right action, wrong action, and inaction.” 
“Right action” means doing our duties and fulfilling our responsibilities. “Wrong action” means ignoring our duties and acting irresponsibly. These two are simple, but “inaction” is difficult to understand. Does it mean just sitting around doing nothing?
So Krishna explains…
“A wise person sees inaction in action; and action in inaction. Such a person can achieve yoga in all their deeds.” 
Puzzled, Arjuna asks, “Action and inaction are opposites. How can one be seen within the other???”
So Krishna clarifies…
“When someone decides to give up selfish motivations in all deeds, her ‘actions’ are consumed by the fire of knowledge. The learned declare her to be enlightened.” 
Good action and bad action both have selfish motives. Good action means to pursue your selfish ambitions responsibly, and bad action means to do so irresponsibly. The third category of karma, “Inaction,” is quite different. It means not to pursue any selfish ambitions at all. This does not mean stopping all action, which is impossible anyway. The wisdom to give up selfish motivations is a fire that transforms action into inaction.
Thus, we can see “inaction in action” by observing the activities of an enlightened person – selflessness in motion. We can see “action in inaction” by seeing a person who retreats from the world for his own sake – selfishness disguised in the garb and symbols of selflessness.
To Arjuna’s likely question, “How can one give up selfish motivations?” Krishna replies…
“She can throw away selfish ambitions because she is independently satisfied within herself. So, even if she appears very busy in so many ways, she is never involved in worldly action. Giving up on the attempt to acquire wealth, she regains possession of her own mind and it is only her body that engages in deeds. Thus she does not become implicated in worldly reactions.” [20-21]
Arjuna will wonder, “Anyone can announce, ‘I don’t desire anything, it is merely my body doing all these things.’ How do we know when this is sincere?”
So Krishna continues…
“If he is satisfied by whatever destiny provides, seeing success and failure as equal accomplishments, he is never implicated by the worldliness of deeds.” 
The karma-yogi works for the sake of duty, not for success of failure. She doesn’t strive for more material development than whatever comes as a natural byproduct of their duty.
“Someone without selfish attachments, whose mind that operates on the level of clear knowledge, is enlightened. They work only as a sacrifice, so all of their karma (actions and reactions) dissolve.” 
“Sacrifice” means that enlightened people work only to benefit others. In the highest sense this means working with a divine purpose, to satisfy the divine. Thus the Sanskrit word for sacrifice (Yajña) is also a name for the Divine Godhead, Viṣṇu.