Republican voters' views differ strongly from what the party pushes and does.

Exploiting this gap is how Trump got elected—remember that whole thing where the Republicans didn't even bother to generate an official party platform when he was running? That's because he threw theirs in the trash and just went with whatever ordinary Republicans chatting with other ordinary Republicans at a backyard BBQ say the government ought to do. Trying to come up with anything like their ordinary platform those years would have been pointless, or even harmful—explicitly adopt Trump's message, and you're in trouble if he ends up going down in flames and you have to backpedal, plus it'll piss off some donors; adopt your usual shit, and Trump's fans will be pissed off at you. So they just didn't make one, which was probably their best move under the circumstances.

Now, the follow-through may have been lacking and any lip-service toward that sort of thing by his hangers-on and imitators may be entirely disingenuous (as his probably was, too, at least most of it), but the gap between R voter and R official or de-facto official policy is real and it's big and Trump's messaging was laser-targeted at using that against his Republican opponents to get the initial nomination.

The "build a wall" stuff was lifted straight from that kind of actual-voter real-talk sort of thing. They literally want the government to just build a wall and assume they only haven't because of corruption and ill-intent among elected officials—it's obviously a good idea, from their perspective. On the campaign trail Trump even vaguely talked about "fixing healthcare" in ways that would surely have looked a lot like "socialized medicine"—because R voters support those policies when they're not being called "Socialist" or "Obamacare" or otherwise being demonized and mis-represented by their own media and politicians. Talk specifics, and they support them, talk about socialized medicine broadly and they tell you to fuck off to Venezuela with the other commies. That's another gap between R voter wishes and R party policy/actions.

Republican politicians also tend to support neo-liberal economic and trade policy, in deed if not in word, while their voters largely hate it (remember the tough-on-China talk and America-first trade policy and the trans-national trade regime skepticism and all that? That's Trump aiming at the party/voter gap, yet again)

"How can it possibly be that a major US political party can largely ignore the actual will of its own voters, for decades on end?" allow me to introduce you to our totally fucked-up electoral system and how it all but guarantees two viable parties at a time, both of which are also all but guaranteed to be disliked by a ton of their own voters. It's extremely bad. :-(

[EDIT] Hell, I wouldn't even be surprised if you could get a very high percentage—maybe not 51%, but a lot—of Republican voters to say they support a federal abortion law that's identical to Roe v. Wade's (maybe even without PP v Casey's modifications) effects—legalizing early abortion, but leaving laws about later-term abortion mostly up to the states—as long as you described what it did instead of short-handing it as "codifying Roe v. Wade" (indeed, you'd have to avoid mentioning that it had anything to do with Roe v Wade at all).