No one gave Trump the election. In fact, great powers in the media & in both parties were arrayed against him.
What I saw was a brilliant (albeit boorish & flawed) campaign to use the media who opposed him to get free coverage, & to also circumvent them to conduct a more grass roots campaign using non-traditional means, eg, Twitter, personal commentary, his own money. He also gets credit for campaigning in a far more strategic manner, ie, he sought votes where it would maximize electoral college votes. Consider that even though she won the popular vote (barely), he had a 290 to 228 landslide where it counted.
The Dems were less sophisticated in their approach, perhaps because they had a false sense of certainty she would win, & because they placed too much faith in their well oiled but conventional campaign machinery.
Trump is a vile hothead, but he is incredibly driven, & smarter than his competition.