He appeared to run a cost effective campaign. The endless free coverage provided by pundits and commentators who continuously mocked was transformed (by him) into a strength. He also made full use of social media to reach as many people as he could. I'd be hard pressed to name another candidate who so effectively used twitter.
The slogan and the hats too. Make fun of him all you want - but it was an effective and cheap marketing campaign. More importantly - its a message that resonated with a lot of people.
That's how you win elections.