How could he, of all people, have not seen this coming?
Trump basically "primaried" his way to the nomination by going hard right to appeal to the Republican talk-radio base. He'll lose of, course, in the general, but that's the basic strategy of winning any Republican nomination. Many, many Republicans have won their local primaries only to lose in the general.