It's almost July and the Republican Party has yet to repeal Obamacare due to divisions within its own ranks. Everything that we thought we knew about the GOP suggests that this should not be the case.

What explains this sudden change in the policy views of Republicans? One explanation is that party affiliation is not as important as previously thought in explaining member behavior once in office. But far from suggesting that parties don't matter, the GOP's present struggles demonstrate that parties matter in a different way. Obamacare's fate ultimately depends on how Republicans view their party.

Suggesting that opposition to Obamacare is an important part of the GOP's political identity would be an understatement. Calls to repeal the law have featured prominently in the party's platform since 2010. Republican candidates at every level have campaigned on an unambiguous repeal message. Speaking at the Conservative Political Action Conference in 2013, then-Minority Leader Mitch McConnell, R-Ky., declared, "Obamacare should be repealed root and branch."

And after finally gaining control of Congress for the first time since Obamacare passed, Republicans turned to a special process known as reconciliation to circumvent a Democratic filibuster in the Senate and repeal the law's major provisions. While President Barack Obama vetoed that measure in early 2016, Trump's victory in the presidential election later that year restored Republican hopes that their seven-year crusade against the law would finally end in victory.

Looking back, such optimism appears to have been unfounded. Five months have passed since Trump's inauguration and Obamacare is still the law of the land. Republican hopes for a quick victory have given way to the realization that progress on this front is going to be a long, hard slog. The GOP's "repeal" legislation, the American Health Care Act, barely passed the House on its second attempt. And Republicans are struggling to pass a watered-down version of the measure in the Senate.

When it comes to Obamacare, our tendency has been to view the role of political parties as providing a cohesive policy link between voters and government. That is, the parties are expected to formulate clear policy platforms, make commitments to voters based on those platforms, and implement policies consistent with those commitments once in office.

Trump's assertion during the closing weeks of the 2016 presidential campaign that "repealing Obamacare is one of the single biggest reasons we must win on November 8" is illustrative of this role.

This policy-centric view of party suggests that Republicans should be able to easily repeal Obamacare given their past commitment and the fact that they also retained their majorities in the House and Senate last November. But it does not explain why they can't despite now being in the position to do so.

Another way of thinking about political parties suggests that they are large, diverse, umbrella-like organizations that seek to appeal to the electorate to form a governing coalition. That is, they seek to aggregate the many interests present in society to appeal to voters, win elections, and govern. Parties articulate the interests of their supporters by representing them in government.

This constituency-centric view of party suggests that Republicans don't want to repeal Obamacare because they think doing so would negatively impact lots of people back home. Given this, Trump's support for repeal may turn out to be less robust than expected because a lot of his voters benefit from Obamacare.

While this may explain the Republicans' present difficulties, it does not account for their past commitments. Popular attitudes regarding Obamacare have certainly shifted in recent months. However, this shift has not been nearly as large as the movement away from repeal among lawmakers. Something else must explain the GOP's struggles.

There is another way of thinking about political parties that captures Republicans' commitments to repeal and their current hesitation to do so. Party behavior in office can be best explained when viewed through the lens of electoral competition.

This candidate-centric view suggests that the parties are not interested in detailed policy work for its own sake or on behalf of their constituent's interests. That is, instead of winning elections to formulate policies, parties formulate policies to win elections.

For the past seven years, the electoral incentives of most Republicans reinforced a strong commitment to repealing Obamacare. The law remained unpopular, the GOP's core supporters were determined to repeal it, and the party lacked the numbers to do so.

But present divisions in the party suggests that some Republicans have reinterpreted the electoral incentives surrounding Obamacare after last year's election. Now the challenge for these members is to demonstrate an effort to follow through on their commitment without jeopardizing future electoral success.

Recent reports that Republican leadership in the Senate is indifferent to the underlying policy details of their version of the healthcare bill suggests that the candidate-centric view is most accurate. If so, the GOP's primary motivation is to get a bill through the Senate that makes some changes to Obamacare but that falls short of full repeal, thereby sparing its members of any negative consequences.

Complicating things is the fact that parties are comprised of individual members. And those members think differently about the role their party should play. For example, some Republicans feel strongly that the GOP should deliver on its long-standing promise to repeal Obamacare. There are also those who advocate a different approach to dealing with the law's Medicaid expansion and insurance regulations. And finally, there are those who do not have strong feelings about what ultimately happens, just so long as something passes in the end.

What ultimately happens to Obamacare will be determined by which of these three views of the Republican Party prevails in the intraparty struggle ahead.

James Wallner (@jiwallner) is a contributor to the Washington Examiner's Beltway Confidential blog. He is a former Senate aide and a former group vice president for research at the Heritage Foundation.

If you would like to write an op-ed for the Washington Examiner, please read our guidelines on submissions here.