Sens. Marco Rubio (R-Fla.) and Ted Cruz (R-Texas) are potential presidential rivals who have staked out vastly different positions on immigration, the biggest legislative battle of the year.

Rubio said he helped draft the Senate's bipartisan bill establishing a path to citizenship for undocumented immigrants "not just because I believe in immigrants, but because I believe in America even more." Meanwhile, Cruz accused the bill's supporters of playing "the race card" by saying to Latinos, "We're going to buy your vote with amnesty."

Despite this immigration antagonism, Rubio and Cruz have partnered this summer on two high-profile initiatives: A ban on nearly all abortions after 20 weeks even when the health of the mother is threatened or when an abnormal fetus cannot survive, and the push to shut down the federal government unless Congress stops funding ObamaCare.

Why are these two rivals working together?

Rubio may be, as many commentators believe, jumping back on the Tea Party bandwagon to mend fences with the anti-immigrant faction on the right. (And in doing so, ignoring my advice to further his role in advocating for immigration reform and prove his leadership abilities.) But that in and of itself doesn't explain why he's partnering with Cruz to do it.

The Machiavellian explanation is that by elevating one libertarian presidential hopeful, Rubio aims to undercut the other libertarian presidential hopeful who poses a more serious threat for the 2016 Republican nomination: Sen. Rand Paul of Kentucky.

Cruz may have the same objective in mind. Attracting an establishment-friendly ally in Rubio gives his crusades more legitimacy and media attention, raising his profile and helping him eclipse Paul for the libertarian mantle.

But such an alliance of self-interest carries major risks for both.

Rubio became an early frontrunner in part by positioning himself as a new kind of leader, willing to take risks to drag his party into the political reality of a multicultural America, and rising above rank partisanship to get things done in a gridlock-savaged Capitol. Yet with immigration reform now on a knife's edge, he appears to have bailed on the landmark legislative effort in order to embrace the lamest sort of pandering.

And the knee-jerk arguments he has to make in the process are disappointing some people who would otherwise be sympathetic to his candidacy. Commentary's Peter Wehner this week lamented "Marco Rubio's Folly" of threatening a shutdown, since the way ObamaCare is funded means it would remain intact even in a shutdown:

Shutting down the government is within the power of the House of Representatives — but defunding the ACA (Affordable Care Act) would require the House, the Senate, and the president to sign new legislation into law. So the Rubio & Co. strategy hinges on an obvious fiction — that Barack Obama and the Senate will agree to pull the plug on his signature (and historic) domestic achievement. [Commentary]

And while Rubio risks undermining his gravitas, Cruz risks launching a debilitating libertarian civil war.

It's an extremely tall order for an outside movement to infiltrate and remake a major political party; witness how short Paul's father fell in his quests for president. But Rand Paul's relatively strong early polling and skill at driving media coverage gives the libertarian movement a unique opportunity to make history.

As I explained previously, the only way for Rand Paul to snatch the Republican nomination, in defiance of the Republican establishment and the party's national security wing, is by consolidating enough right-wing factions around his candidacy. If he can attain about 30 to 40 percent of the vote in the early contests, while establishment Republicans split among several more mainstream candidates like New Jersey Gov. Chris Christie, former Florida Gov. Jeb Bush, or Rubio, Paul would have enough to win pluralities and catapult his campaign to victory.

Typically the opposite happens. Several fringe candidates run and splinter the rabid right-wing base, while establishment types eventually rally around a single mainstream figure. A Paul-Cruz catfight would likely cause that history to repeat.

The fact that Cruz is throwing a lifeline to a floundering Rubio instead of boosting his ideological comrade Paul suggests Cruz is putting personal ambition ahead of what best for libertarianism. If that becomes the popular perception of Cruz's machinations, his stature among libertarians may become diminished.

Rubio and Cruz are taking these risks in pursuit of dead-end gimmicky legislation. The abortion ban is flagrantly unconstitutional. The defund ObamaCare gambit is sad rerun of a battle long lost.

Paul is no stranger to dead-end legislation. He also supports unconstitutional abortion legislation and the shutdown scheme. But he is also talking about developing a libertarian approach to resurrecting Detroit. In other words, Paul is trying to show that he has a philosophy that can produce new ideas to help solve pressing problems. If Rubio and Cruz feel compelled to compete with Paul, they might consider trying to compete in the arena of ideas.