Due to the laws of nature, it is impossible to remain inactive. Therefore, it is necessary to do the right thing. Doing right thing means (1) doing things according to swabhava/nature (2) not doing something against your conscience. An empty mind can become devil’s workshop by doing wrong work. Or, an empty mind can be consumed by random thoughts draining vital energy compromising health. An attitude of doing natural work considering it as your need to do so is Karma-Yoga.
To put it simply, Karma-yoga means accepting result completely. Unless we watch the mind and recognise thought patterns, this attitude can not be applied effectively. When we watch the mind we find that many times we blame ourselves and many times we blame others repeatedly. This inner blame game goes on unconsciously in the form of mental chatter even if we know what Karma-yoga attitude is. This happens due to the conditioning of the mind. The mind becomes conditioned to blame and all this happens unconsciously. When we start watching the mind, this inner game of blame is no longer hidden and then if Karma-yoga is applied it becomes highly potent and gives peace of mind. Blame after all means the denial or non-acceptance, whereas Karma-yoga is about acceptance. Blaming goes away when there is acceptance. Try to catch yourself when you blame yourself or when you blame others creating repetitive mental chatter (Madhyama Vaani).
Karma-yoga means doing an act with an intention to serve/contribute just because it is one’s duty/nature/swadharma/swabhava/prakrati to do so (the creative potentiality hard wired in us can only be satisfied if it is expressed) without taking the ownership of the result and accepting the result as prasad. Since laws of nature control the outcome, this attitude frees oneself of the pride associated with success or guilt associated with failure and makes one accept any result with grace. Now, what makes Karma-yoga lead to yoga or union? When mind is free from agitations, yoga automatically happens. Mental agitations are primarily caused by inaction and by uncertainty over result of an action due to desire/aversion towards a particular outcome. Karma-yoga prompts one to act and with Karma-yoga attitude the uncertainty over result no longer agitates the mind since any result is accepted with evenness of mind. As mind gradually quitens, yoga happens.