The heart does not actually work on its own to pump blood all the way around the body, this is because there would be a high amount of pressure at the area of the heart and a significantly lower pressure at the extremities.
So, imagine blood being pumped away from your heart to the whole of your body, this is perfectly fine for the heart to do. But how does it come back from your legs in order to be oxygenated once the oxygen has been taken by your cells?
The pressure is a lot lower and it would struggle to return to your heart and then to the lungs without a little help.
The heart, therefore, needs the help from a second system. This second system is essentially a system of valves that are scattered along the veins of your body.
Since the pressure is a lot lower in the veins, as the blood is having to return up the body to the heart, these valves are essential. These valves will close when blood begins to flow back the wrong way, so that blood can only flow back to the heart.
But these valves do not close on their own. They are triggered by the potential backflow of deoxygenated blood but are helped along by other processes in the body.
When we are moving around, the muscles in our body called the skeletal muscles will contracts. These contractions from the skeletal muscles happen when we are walking, standing and moving around in general.
These muscle contractions are what basically squeeze the deoxygenated along the veins back to the heart with the help of the veins closing too.
So, the combination of the heart pumping and still having a small effect on the deoxygenated blood, the valves closing in the veins, and the muscle movement all help to make sure the blood gets back to the heart.
All of these things help the blood to move against the pull of gravity.
What if it goes wrong?
Sometimes valves can malfunction and stop closing all together. This means that the backflow of deoxygenated blood would not be hindered by the valves in the veins.
The blood would then accumulate in the veins and cause swelling which is called varicose veins.
How does the blood keep flowing against gravity?
Since we have evolved on the very earth whose gravity our blood has to pump against, our venous system is equipped to combat gravity. If a valve fails to work properly, gravity is the force that causes it to fall back down the legs.
So, the best way to keep this from happening is to exercise often, since this will encourage the skeletal muscles and the leg muscles to contract and thus squeeze the blood along. If your blood is simply relying on the valves, then it will be more likely to succumb to gravity’s pull.
Your blood is more likely to healthily flow back up along the veins to the heart if the muscles around the veins are working hard. Therefore, exercise is essential, hence why varicose veins are more common in people who exercise less.
To conclude then: the heart is a strong organ, strong enough to pump blood to your extremities through your arteries. But it is not strong enough to pump the blood back up along your legs alone.
Valves in the veins of your legs (and other veins) will prevent the blood from succumbing to gravity and falling down the veins.