The United States has a political system called a democratic republic. In a democratic republic, we elect our leaders to represent us. Our leaders are supposed to listen to the people who elect them and cast votes based on the wishes of the majority. In a pure democracy, all eligible voters would vote on issues that required votes. That kind of system would not be reasonable in a country the size of the United States.
It is interesting to note that the writers of the Constitution had little confidence in the average person to make wise decisions. They created the Electoral College to choose the President because they believed the average person wasn’t capable of making wise choices for our leaders. Thus, it is possible, and it has happened a few times, that a presidential candidate won the vote of the people but didn’t become President. Additionally, in some states, a person had to own property in order to be able to vote.
In an ideal world, in our democratic republic, our leaders will vote the way the majority of their constituents want them to vote. That doesn’t always happen in today’s political world where loyalty to the political party has become increasingly important.