Why and How the Split: 
Different Winners with Electoral College and U.S. Popular Vote
In 2012, re-election for Democratic president Barack Obama included having won the popular vote by +3.86 over losing Republican challenger Mitt Romney. (Obama, 51.02%; Romney, 47.16%.)
Effective December 11, 2016, at 11:00 a.m. ET, Hillary Clinton held the popular vote by +2.08. (Hillary, 48.08%; Trump, 46.00%.) That means a 2012-to-2016 national Republican shift of +1.78 percentage points. 
(See: http://uselectionatlas.org/RESULTS/ .)
That doesn’t explain enough. 
Donald Trump needed a national Republican shift of +3.87 to win over the popular vote by at least +0.01. He did this in only 25 of the nation’s 50 states. Typically a party-pickup winner will pull this off in a clear majority of states. (In 2008, Democratic pickup winner Barack Obama met his number in 43 states. In 1992, Democratic pickup winner Bill Clinton reached in 41 states. In 1980, Republican pickup winner Ronald Reagan came through in 46 states.) 
Looking at that maps, above, the first is the official map with Election 2016. Light shades of red are the Republican pickup states for Donald Trump. With the second map above, the states colored in red are the ones in which Donald Trump shifted at least +3.87 in his direction. For those in which he did not reach, they are colored blue (Advantage for Hillary Clinton).
Hillary held off Trump, to indicate she would win the popular vote, with states plus District of Columbia which comprise 328 of the 538 electoral votes—that is, 60.96 percent. So, this illuminates how we can get a split-outcome result in a presidential election.
Of the Top 20 most-populous states, worth 369 of the 538 electoral votes, Trump shifted to a level necessary in just 8: New York, Pennsylvania (pickup), Ohio (pickup), Michigan (pickup), Indiana, Tennessee, Missouri, and Wisconsin (pickup). Those pickup states comprise +64 electoral votes. Added to Mitt Romney’s 206 electoral votes…right there are 270 electoral votes. 
With other pickups, Trump also shifted Iowa sufficiently as well as Maine's 2nd Congressional District. He did not reach a +3.87 shift with his pickup of Florida. So, 277 of his 306 electoral votes were because he was able to get 71 of his 100 pickup electoral votes with a 2012-to-2016 shift that was at the level he needed.