Why does the electoral vote matter more than the popular vote?

President Trump and President George W. Bush won the electoral vote during the election, but not the popular vote. How does the electoral college work?