Compression stockings work by exerting graduated pressure on the legs, which means the pressure is highest at the ankles and gradually decreases as you move up the leg. This helps in pushing the blood back up towards the heart, preventing pooling and improving overall circulation.