Heart is just a pump. It pushes the blood in the arteries towards the body carrying not only oxygen but nutrients and other things. When it passes through the capillaries, blood enters the veins. In a resting person, the veins will be carrying back around 20% less oxygen than in arteries (it will be lot less, if the person is exercising). One thing which it gets from the cells when entering the veins through capillaries is the waste products from the cells. Waste products consist of CO2 (plenty of it) and other substances (including metabolic acids). All veins unite together to form inferior vena cava from the lower part of the body, lower than heart). From upper part all veins drain into Superior VC. So when it enters the heart, it is low in O2 (lower value depending upon how much the person has consumed) and high in CO2 and other waste products. CO2 will be cleared by lungs when the blood goes in the pulmonary arteries, other waste products will be either dealt by the kidney or the liver.