sattvaatsanjaayate jnyaanam rajaso lobha eva cha |
pramaadamohau tamaso bhavatojnyaanameva cha || 17 ||

From sattva arises wisdom, and rajas from greed. Heedlessness, error as well as ignorance arise from tamas.
sattvaa : from sattva
sanjaayate : arises
jnyaanam : knowledge
rajasaha : rajas
lobha : greed
eva : also
cha : and
pramaadamohau : heedlessness and error
tamasaha : tamas
bhavataha : arises
ajnyaanam : ignorance
eva : also
cha : and
Previously, we took the example of people who make it a habit to go to the gym everyday, and eventually make it into an integral part of their lives. If we fast forward that example a few months further, we find that these people have lost weight, they are taking care of their body, they are eating healthy, avoiding smoking and so on. Their persistence in getting over the initial pain of going to the gym has paid off. They enjoy the state being healthy and being fit. Intelligent action has shaped their physical state, and consequently, the physical state gives its result.
Similarly, mental states that were shaped by intelligent actions give results as well. Shri Krishna says that sattvic mental state gives us access to material and spiritual knowledge, since our intellect improves its ability to think clearly and grasp information quickly. A rajasic mental state makes us act in the world to rush after objects. We want objects we do not have, and want more of objects that we already have. A tamasic mental state has the worst possible outcome. It keeps us steeped in ignorance of the material world, and of our true nature. We do not want to act at all, and even if we do, we perform furtile actions, or perform careless actions.
This shloka and the prior shloka point out the self reinforcing nature of actions and gunaas. If we consciously perform sattvic actions day after day, we will generate a greater proportion of sattva in our mind, which will further spur sattvic actions. This is the logic behind karma yoga. By urging us to perform selfless actions, Shri Krishna wants us to rise from our rajasic and tamasic existence to one of greater sattva.