A depot used to store pipes for Transcanada Corp’s planned Keystone XL oil pipeline is seen in Gascoyne, North Dakota in this November 14, 2014 file photo. (REUTERS/Andrew Cullen)

Yesterday the Senate tried, and failed, to override President Obama’s veto of the Keystone XL Pipeline Approval Act. Obama’s veto  was just the third of his presidency, but almost everyone agrees that it will not be his last. My research helps explain why the attempt to override Obama’s veto was doomed from the start.

The success of any override typically depends on the level of support a bill received during final passage. As political scientists Richard Conley and Amie Kreppel suggest, vetoes like the Keystone Pipeline one are the most interesting because the outcome is in doubt. The final passage vote on the Keystone XL Pipeline Approval Act received around 62 percent support in both the House and the Senate — not far from the two-thirds majority needed to override the veto. The Senate had to act first to override the veto because the bill originated in the Senate. So why didn’t the Senate do this?

I find that members of Congress switch their votes on veto override attempts in response to changing electoral or ideological pressures. This time, senators who originally voted against the Keystone XL Pipeline Approval Act did not face either type of pressure during the veto override attempt.

Every Democratic senator who voted against the bill represents a state that Obama won in 2012. Moreover, most of these senators had already issued statements explaining their opposition to the pipeline. These senators were unlikely to switch their votes after so clearly and publicly explaining their opposition.

Finally, only three of the 20 Democrats who voted against the bill and represent states where Obama won less than 60 percent of the two-party vote are up for reelection in 2016.

The override attempt was doomed in the House even if the Senate had overridden the president’s veto. The House doesn’t contain enough potential vote switchers either.

I have found that, on average, between 4 and 5 percent of representatives switch their votes during veto override attempts on contested vetoes in the House. This fact might seem like happy news for Republicans. It is not.

Almost all of what I call “presidential defectors” – members who vote with the president on final passage and then switch their votes to defect from his coalition during the veto override attempt – are members of the opposition party. In this case, only one House Republican, Justin Amash, originally voted against the Keystone XL Pipeline Approval Act. He did not seem likely to switch his vote. If House Republicans wished to override Obama’s veto, they needed to convince 19 Democrats to switch their votes.

Is there any chance that 19 Democrats would have switched their votes? This possibility seems extremely unlikely. On average, less than 2 percent of presidential party members become presidential defectors during veto override attempts. As many as 151 House Democrats voted with the president to oppose the Keystone XL Pipeline Approval Act. If the historical average held true, Republicans could have counted on two or three of these Democrats to switch their votes.

That much Democratic vote switching would have been offset by the historical average of “presidential joiners” – members who vote against the president on final passage and then switch their votes to join his coalition during the veto override attempt. On average, around 1 percent of opposition party members switch votes to join the president, which in this case would have meant two or three Republicans switching votes to sustain the president’s veto.

In short, even if the bill got back to the House any vote switching during the veto override attempt would have likely occurred on both sides of the aisle and canceled itself out.

What if the historical averages didn’t hold true? Again, I’d caution that such a scenario was unlikely in this case. Most vote switching occurs when presidents veto bills that deal with less salient issues. The president’s veto raises the public’s awareness of the issue and thus changes the pressures that influence how members vote. The highly contentious Keystone XL Pipeline is not such an issue.

President Obama’s veto was sustained because the highly public debate over the Keystone XL Pipeline meant that members of Congress had already considered the relevant electoral and ideological forces before the final passage vote. As a result, few members of either the House or the Senate had reason to switch their votes during the veto override attempt.

Patrick Hickey is an Assistant Professor of Political Science at West Virginia University.

For more on this subject, see “Where do vetoes come from?”