The Republican race, fought until now in high-profile state contests and made-for-TV debates, is turning into a shadow war.

Donald Trump’s dominant delegate lead means that neither Sen. Ted Cruz nor Ohio Gov. John Kasich can realistically win the nomination outright. But the split in the party also means Trump will have a tough time securing the 1,237 delegates needed to win as well, possibly falling just short of his goal.

If no one hits the magic number, there will be a contested convention in Cleveland this July, meaning the vast majority of delegates eventually would be allowed to vote for anyone they choose.

Making matters more difficult for Trump, candidates rarely choose their own delegates. Instead, in 44 states there’s a patchwork selection process across local and statewide conventions that are sometimes controlled by established party leaders.

Related: Revealed: Donald Trump's Campaign to Thwart a Contested Convention

That means the GOP contest could be won by whichever campaign dominates the normally sleepy selection process and successfully cajoles delegates unaligned with any candidate.

“Going into this convention, they’re going to try to do a lot of manipulation to try to keep Trump from becoming the nominee,” Nevada delegate and Trump backer Diana Orrock told CNBC on Monday.

Already, Republican leaders are preparing voters for the possibility of the front-runner falling short if he fails to hit 1,237.

“Plurality is a minority, and a minority doesn’t choose for the majority,” RNC chairman Reince Priebus said in an ABC News appearance on Sunday.

Related: Full Coverage of the 2016 Race at MSNBC.com

Trump, on the same program, called the process “unfair” and has previously warned of “riots” from supporters if he doesn’t secure the nomination.

Most delegates are required on the first ballot to back the candidate who won their support through a primary or caucus, but there’s no guarantee they stick with that candidate once they’re free to vote their conscience.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Delegates are also needed to stack the convention committees, which could dramatically affect the outcome of the race, depending on how the committees change or interpret the convention rules. A committee could, for example, drop the restrictions binding delegates to candidates on the first ballot to undermine Trump. There are also likely to be fights over who’s eligible to even receive votes – the existing rules require candidates to have won a majority of delegates in eight states.

There are 210 free-agent delegates who enter the process without ties to any candidate, either because their state didn’t run a primary, like Colorado, or because they’re party officials who are automatically chosen in some states.

In addition, a couple hundred other delegates – most notably Marco Rubio’s 168 delegates – were allocated to candidates who have since left the race. States decide what happens to those delegates at their conventions, but The Hill estimates that as many as 81 will be unbound on that first ballot.

It will be up to the campaigns to both unbound delegates and infiltrate the selection process to pick trusted delegates while installing double agents with their rivals.

Related: Criticism of Trump Draws Harassment and Violent Threats

“The big X factor is organization: which campaigns have done the hard work of getting their folks organized in their state committee and conventions that elect the delegates,” John Yob, a GOP strategist who wrote a book on the convention and is trying to secure a delegate spot in the Virgin Islands, told MSNBC.

This is easier said than done. Take Arizona, where Trump won all 58 of the state’s delegates on Tuesday. Three of the delegates are reserved for current party leaders. The other 55 are chosen through a tiered system in which previously elected precinct committee members hold local conventions on different dates to choose state delegates, who then attend a state convention on April 30, where they choose the national delegates who will actually vote for the Republican nominee.

Got it? Now, multiply that across dozens of states, districts and counties, and you get an idea of the scale of the challenge.

Trump, Cruz and Kasich are all already working to win over delegates and direct the process in states where they’ve yet to be chosen. But experts give Cruz an early edge, thanks to his extensive grassroots network and (in comparison to Trump) closer ties with party leaders, who often have an outsized role in the selection process.

“That’s where Cruz has the advantage,” Josh Putnam, a political scientist at the University of Georgia who researches delegate rules, told MSNBC. “He seems better positioned, at least at this point, to identify folks sympathetic to him and then get them elected to those delegate spots.”

Unlike the state primaries and caucuses, we may not know who is winning the delegate race for months. While campaigns will try to put up their own loyalists, parties frequently choose slates of established officials and donors without regard for whom they might support at the convention itself.

Yob, the GOP strategist, recommended watching the names state delegations send to the key committees – Rules and Credentials. Each state and territory gets to pick two members, and if they choose obvious partisans for one candidate, it would suggest that campaign has significant support.

“Those true commitments will start to come out in the committee assignments,” he said.

On Thursday, the Wall Street Journal reported that pro-Cruz delegates in Louisiana, a state Trump won, had secured five of the six committee assignments available and that Cruz may have netted 10 delegates overall from the delegation over Trump. One of the Trump supporters left off the committee list, Kay Kellogg Katz, did not sound confident in the campaign’s delegate operation.

“I do not know Mr. Trump, I do not know his staff people,” she said. “Quite frankly, we don’t have much of a campaign in Louisiana. All we have is voters.”

Curly Haugland, a Republican national committeeman from North Dakota, predicted to National Review that Cruz would win Arizona’s delegates in a contested convention as well because the party officials who choose them tend to favor his brand of movement conservatism.

“Voters in the primaries are not representative of the people who are going to be sitting in the chairs in Cleveland,” Haugland said. “The convention delegates from Arizona are going to be very conservative people.”

Related: Ted Cruz: Trump is a ‘Sniveling Coward’

In South Carolina, where Trump swept the primary, delegates are required to have held positions in the state’s 2015 convention as well. That leaves Trump with no chance to install party outsiders more likely to favor his campaign.

It’s not enough for Cruz just to ensure anti-Trump delegates make it to the convention, however. He has many detractors inside the party, and if the delegates view him as a damaged alternative, they could try to draft an outside candidate instead.

In Wisconsin, which holds its GOP primary on April 5, Gov. Scott Walker speculated on Thursday that a split convention would pick someone else entirely. Mitt Romney, the 2012 nominee, and Wisconsin’s own Speaker Paul Ryan are two popular choices.

“I think if it’s an open convention, it’s very likely it would be someone who’s not currently running,” Walker told reporters.