As recently as a year ago, Republicans were actually looking forward to the 2016 presidential election. The field, it was widely assumed, would include a number of experienced and credible candidates; since Barack Obama’s election in 2008, the GOP had made significant inroads at the state level and now controlled the majority of state legislatures and governorships. And the eventual Republican nominee, it was further assumed, would likely face a known quantity in the general election. Hillary Clinton, the presumptive Democratic nominee, faced burgeoning controversies and certainly seemed beatable. The darkest cloud on the horizon, for Republican forecasters in May 2015, was probably Jeb Bush. Should the former governor of Florida decide to run for the office once held by his brother and father, the primary could yield a dispiritingly dynastic general election—another showdown between a Bush and a Clinton. Ho-hum.

A year later, of course, such conventional wisdom has been smashed to a pulp. It’s not hard to understand why most observers initially dismissed Donald Trump, the publicity-hungry real estate developer turned reality-television star, when he announced that he would seek the Republican nomination last June. But it was jarring to watch so many members of the political and media elite insist, over the months that followed, that Trump’s prospects of winning were negligible—even as his poll numbers rose and the potential consequences of this collective complacency began to materialize.

By the end of March, more than two dozen states and territories had held their primaries and caucuses, and more than half of the delegates to the Republican National Convention had been allocated. The field, which once numbered seventeen candidates, had been winnowed to three, including Texas’s junior senator, Ted Cruz. Experienced leaders like Rick Perry and Lindsey Graham had suspended their campaigns even before the first votes were cast in the Iowa caucus. Once-rising stars like Rand Paul and outside contenders like Carly Fiorina exited the race without winning more than a single delegate. The expected Jeb juggernaut ended in ignominy after a blowout defeat in South Carolina. Marco Rubio, once hailed as the fresh face of a more inclusive and forward-looking Republican party, was humiliated by a double-digit loss to Trump in Rubio’s home state of Florida. It’s still too soon to say who the Republican nominee will be. The matter will likely be decided at the party’s national convention in Cleveland in July. But Trump is clearly leading the race. He would already be the presumptive nominee if not for Cruz.

The good news, I suppose, is that no one can accuse the Republican party of being boring or becoming mired in the kind of staid thinking that led it to put forth a candidate as dignified and experienced as Mitt Romney four years ago. And, to be fair, the Republicans have not nominated Trump for president just yet. In fact, it’s still possible they will not. Those of us who have followed Cruz’s meteoric political ascent since it began, just four years ago, can understand why. Even his opponents would concede that Cruz is an unusually shrewd, agile, and far-seeing strategist who has run an extremely competent campaign. That’s why he’s still standing, despite starting the race as an afterthought, facing open hostility from the party establishment, and having to contend with the ideologically amorphous, insult-spewing disruption leading the field. And should Trump fail to arrive in Cleveland with the pledged support of a majority of the delegates—which became increasingly likely after his decisive defeat in Wisconsin on April 5—he can expect Cruz to teach him a painful lesson about the party rules, under which a trailing candidate may well outmaneuver the frontrunner and emerge from the convention as the nominee.

That scenario would offer little relief to the many Republicans who see Cruz as a seriously flawed candidate himself: an ideological hard-liner who would doom the party in the general election, an obstructionist who has alienated most of his colleagues in the Senate, and so on. Whether those criticisms are fair or not, Cruz will have to allay them should he hope to lead the GOP, rather than merely win the grudging acceptance of the establishment leaders who were, themselves, unable to stop Trump—and were desperate to wrestle the party back from a reality-television performer.

But even if Cruz does save the GOP from Trump, the party is clearly overdue for a serious reckoning. Democrats might put the issue more strongly than that, and they’d have a point. Any party that would come so close to nominating a presidential candidate like Trump, with his ignorance, instability, and viciousness, is a party that, collectively, has already failed.

Perhaps the saving grace for the GOP is that Trump’s rise isn’t necessarily a repudiation of all conservative principles. Trump benefited from a large field of candidates, winning with 30 to 40 percent in the early primaries. In every state that has voted, a majority of Republican voters have rejected Trump. And some of the most trenchant critiques of his candidacy have come from the right; after all, conservatives can best specify how his various apostasies and degradations discredit the causes that they have, in some cases, worked for years to advance.

Still, the Trump phenomenon is a deeply troubling one that has been long in the making. A look at the trends in Texas, for instance, provides plenty of fodder for critics who say the Republican party has brought this on itself. Since the nineties, as we all know, the GOP has amassed hegemonic power in state government. That in itself demonstrates that Republicans aren’t incapable of governing; if not for the state’s economic success under Republican control, there might be greater public demand for the dormant Democrats. With that said, twenty years of one-party rule, reinforced by several rounds of partisan redistricting, have given rise to a well-documented and ominous dynamic: most of our statewide and legislative races are decided in the primaries. The most ferocious electoral fights in Texas, in recent cycles, have been between moderates and conservatives rather than Republicans and Democrats.

The importance of the primary, relative to the general election, has warped the state’s political debates in an increasingly consequential way. Republicans have an incentive to cater to the party’s base, or at least to camouflage any inclinations toward civility, cooperation, or pragmatism that might raise suspicions among the grassroots that they’re insufficiently “conservative.” Any history of the latter, no matter how objectively defensible, can be invoked against a Republican in a primary. By contrast, a candidate who successfully asserts himself or herself as the real conservative, relative to any other Republican in the vicinity, often seems invincible. Any criticism, however valid, can be dismissed as ideologically motivated—the predictable slander of the liberal media or the corrupt establishment. And should critics offer corroboration of their initial claims, the true believer has a ready response: the provision of so-called facts and putative “evidence” is proof of the critics’ desperate desire to scuttle an adversary who threatens their grip on power. This is how we ended up with Ken Paxton, since indicted on multiple felony counts, as our attorney general.

This dynamic also explains why Trump, who has scant history of working for conservative causes, or even agreeing with them, has managed to cast himself as a standard-bearer for the party of Reagan. The voters have been groomed to believe that criticism of  Trump is a form of persecution. And Texas Republicans, from one perspective, have no right to complain: the manual Trump is reading from is one that they wrote and that many of them have used to serve their own ambitions, including one Ted Cruz.

At the same time, all politicians are overly ambitious, and it’s rare for any of them to get far without some talent for artful dissembling. The defensibility of campaign tactics depends on where the line is drawn. While Texas Republicans have pushed the boundaries of fair play pretty far, they do have their limits. This year’s primary showed us that.

Texas conservatives mounted a number of challenges to incumbents they abhor as moderates, including Joe Straus, the speaker of the Texas House, and two of his key lieutenants, representatives Charlie Geren and Byron Cook. Meanwhile, a number of the more contentious tea party–type incumbents, like state representatives Jonathan Stickland and Molly White, faced challenges from the exasperated establishment. The results were somewhat unexpected: reason won out. That’s because in all of the closely watched primary challenges, the quality of the incumbent in question—conservative or moderate—seemed to take precedence over the arcane ideological disputes.

White, the most woeful member of the House’s tea party faction, was defeated. But Stickland prevailed easily, as did similarly serious compatriots, such as Tony Tinderholt and Matt Rinaldi.

Concurrently, Geren and Cook also won their primaries despite heated challenges from right-wing candidates who accused the incumbents, correctly, of having enabled the success of Straus’s regime. And no one posted a more striking victory than the speaker himself. The primary challenger he faced this year, Jeff Judson, was well funded and enjoyed the enthusiastic support of activists such as Michael Quinn Sullivan, of EmpowerTexans, whose antipathy toward Straus is obsessive. Yet even with Cruz, a tea party favorite, at the top of the ballot, the speaker’s opponents face-planted. Straus obliterated Judson by 30 points. Perhaps most importantly, Texas resisted the great beclowning that has befallen so many states this year: Cruz won the presidential primary by 17 points over Trump.

This year’s Texas primary, then, might be instructive for Republicans who have watched Trump’s progress with dismay and who are still holding out hope for a reformation—and it should be instructive for Texas’s leaders. Across the state and the nation, all too many Republicans have succumbed to the temptation to seek short-term electoral advantage with campaigns focused on identity politics and litmus tests. This tendency has enabled the rise of Trump, whose campaign has already damaged the party so much that the GOP as we know it may not survive.

More to the point, it has done the state and the country no favors. It’s one thing for a political party to have internal debates about policy and process, and some of Texas’s contested Republican primaries have hinged on tangible differences. But all too often the challengers have cast their version of conservatism as the only one that passes muster, from an ideological or a moral perspective. This is intellectually dishonest, plus it has drawn the party into an increasing obsession with marginal issues and personal grievances. And it wasn’t even necessary. The Texas primary showed us this much: the voters are most interested in whether their elected leaders are effective. We the people want results and good governance. We deserve better than Trump—and the debased GOP that allowed him to thrive.