I would argue that Trump was significantly smarter than the median GOP primary candidate in '16 and '24. A lot of folks love to pillar him as stupid, but he clearly has an ability to read a room and reflect those feelings back to a crowd in a way DeSantis and Huckabee and Jeb! did not.
He was a frequent guest on the Howard Stern show. He continually forced himself into the lime light every single chance he got. Even the stupidest of fools is bound to develop a skill or two along the way, and over time he did develop media skills and the ability to read a crowd. But he's still as stupid as a bag of soup.
But I also think he’s a product of the historical moment. His popularity is largely a consequence of decades of political orthodoxy on Rich People Being Better Than You, hammered into the heads of his base voters.
I largely agree with you, but I think his stupidity is a selling point as well. It's what endears him to "the base". He thinks like they do: poorly, infrequently...stupidly.