First, Trump surely knew that he wouldn’t win. He is an arrogant blowhard, but not a moron. If he expected to win he would have learned the basics of policy (either foreign or domestic). If he expected to win he would have actually put his campaign in a furnished room. If he expected to win he would attend critical forums. If he expected to win he would actually fundraise. Trump is not doing what it takes to win an election. I suspect he isn’t even trying to get on ballots (i.e. hire staff dedicated to securing delegates in early voting states), since it is appearing more evident that he does not care about winning the primary.
However, as much as he doesn’t care about winning he certainly cares about losing. Trump’s biggest insult, the thing he hates most is a loser. Trump absolutely cannot lose. So if Trump is unwilling to lose, and unwilling to win what other option does he have? Going out on top. That’s right, rising to the top of the field in a year when a republican will win and then leaving. That way he can tell everyone for the rest of his life that he would have been president. He never lost. The only reason he wasn’t president is [insert narcissistic rant here].
But the only way to pull off such a feat is to leave the field as the undisputed #1 candidate. Right now Trump leads Iowa, New Hampshire, South Carolina, Florida, California, and national polls. However, Trump’s margins are closing fast. His margins are down in each state and nationally. The only reason he is not #2 right now is because the outsider movement went to Fiornia rather than Carson.
Donald Trump has spent almost no money but generated massive publicity. He has not built a campaign and shows no signs of doing so. He staffs his entire campaign with furniture that could be improved with the help of the “for free” section on Craigslist. He cannot stand a loser, and will not allow himself to lose. I think this is a month or two earlier than he planned, but he will not remain in the race as #2, and he has no plans of winning.
Also, he loves causing chaos and people to obsess about him. Walker is getting ~2 days of media attention by leaving at #11 or so. Trump would want the news cycle to discuss his exit for at least a week. That cannot be done by leaving while in the bottom third.
** By the way, until today I thought Trump might actually intend to fight for the nomination. The fact that a multi-billionaire intends to self-fund his campaign but probably spends more on his housekeeping staff than campaign staff changed my mind. While narcissistic egomaniacs tend to do unexpected things and frequently surprise, I would be absolutely shocked if he stuck around until he was #2 in the polls.