Speaking directly to the OP question:
Trump tapped into the blatant racism which has always been in the hearts and minds of about 50% of the country.
The traditional Republican “base” has always been evangelicals, rich folks and large corporations, gun-lovers, gay-bashers and anti abortion radicals..
And the good old boy, garden variety, rebel flag waving racists.
But almost all of those rich, gun loving, gay/abortion hating evangelicals ARE ALSO RACISTS to a certain extent.
Trump tapped into the racist in all of them, and it started with his birtherism of Obama back in 2008. Had McCain won, or had Romney won in 2012, we wouldn’t be here right now, and neither would trump.
But McCain and Romney didn’t tap into the racist nature of half of Americans. Trump did it, got lucky in opposing a flawed Dem candidate in 2016 and the rest is history.
Nobody will ever convince me that all of this trumping maga nonsense doesn’t boil all the way down to simple racism