How was Trump able to make a good comeback to the white house by winning both the popular vote and electoral college?

I'm not American so I need a clarification

How was Trump able to make a good comeback to the white house by winning both the popular vote and electoral college?
Post Opinion