What do you mean by demography? Are you talking about the popular vote? Well, that is not how the
President is elected.
The
United States of America is, as indicated by the first word, a
Union of States. The President is not elected by the Union. The President is elected by the States. At each state, it is a democratic process. Whoever wins the state, wins all the electors (see 1 below). At the Union Level, it is the Electoral College made up of electors with unequal powers (see 2 below) who elect the President. The USA is a Constitutional Republic.
So, Hillary won the majority vote of the Union, i.e. the USA, but Trump won the majority vote in a majority of the states.
- Except Nebraska and Maine. Here, the House votes are given proportionally as per whoever wins the Congressional District and the winner of the state gets the two Senate votes.
- Low population states have more electors per capita. An elector from Wyoming is more powerful than an elector from California.