Krishna says (2.39) that after elucidating about Sankhya (awareness) (2.11-2.38) he would now explain yoga (or Karma Yoga), the practice of which will free one from karma bandhan (bondage of action).
While explaining Sankhya yoga, Krishna makes Arjun aware that he is that indestructible Chaitanya (consciousness) which doesn't have death. From this verse onwards Krishna starts explaining the same through karma yoga. Thus, karma bandhan and yoga need to be understood in this context.
Yoga literally means union and is used in many contexts. Krishna mentions equanimity as yoga (2.48) where attachment to success or failure is abandoned. Even in 2.38, the emphasis of Krishna is to maintain equanimity towards pleasure and pain; winning and losing; and profit and loss.
Karma Bandhan refers to the impressions or scars, both pleasant and painful, left on us by the karmas we perform and the reactions we get from within and outside. Scientifically they can be called neural patterns. These impressions drive our behaviour from the unconscious level and hence Krishna tells us to free ourselves from karma bandhan through yoga.
Our natural tendency is to cling to impressions that give pleasure and profit. We develop a simultaneous aversion to pain and loss. The more deep-seated these impressions, more is the intensity of clinging and aversion.
The strength of these impressions can be metaphorically compared to writing on a stone, sand and on water. When the impression is on stone, it is deeper and affects us for a much longer time. Less so with writing on sand. Writing on water, on the other hand, is erased instantaneously.
Krishna is referring to impressions on water when he says that karma yoga frees us from karma bandhan and it makes us so saral (gentle) that nothing can affect or bother us.
Source - Daily World