The circulatory system, including the heart and blood vessels, is responsible for ensuring proper blood flow to the legs. Any disruption in this process, such as narrowing of arteries or blood clots, can lead to leg pain.