On Wednesday, Presidents Barack Obama and Raúl Castro announced the most profound change in relations between the United States and Cuba in decades.

Why now? What explains the timing of this historic change to a policy in place for over half a century? The short answer is that the decision to restore diplomatic ties between the two countries was driven by a surprising convergence of biology and technology. Biology dictated the aging of the Castro brothers and other leaders of their revolutionary generation in Cuba, as well as the graying of the Cuban exile population in Florida. This dynamic altered old political balances both inside the Cuban regime and in U.S. electoral politics. Technology—especially innovations in the extraction of shale oil and gas—allowed the United States to upend the world’s energy map and push down the price of oil, thus undermining the ability of Venezuela, a major oil-exporter, to continue providing a lifeline to Cuba’s bankrupt economy. Cuba needed an economic alternative, and the U.S. became one.

The United States first enacted its economic embargo on Cuba in 1961 with the explicit purpose of ousting the Castro regime. In 1996, the policy was hardened with the passage of the Helms-Burton act, which tightened the embargo and sought international sanctions against the regime in an effort to unseat Castro and bring democracy to the island. It didn’t work. Not only did the Helms-Burton act fail to attain its goals, but it also constrained the White House’s foreign-policy options. Both the Clinton and Bush administrations were stymied in their ability to make any significant changes to a law that was shaped more by narrow calculations related to U.S. domestic politics than by a broader view of U.S. national interests in the hemisphere. Specifically, Republican and Democratic politicians sought the support of the large population of Cuban exiles who voted in the swing state of Florida, and resisted efforts to change or liberalize some of the most stringent conditions of Helms-Burton.

Presidents always had the possibility of acting unilaterally through executive orders, but this electoral calculus deterred them from doing so. That calculus changed with two recent political trends: persistent congressional gridlock and the results of the 2014 midterm elections, which gave Republicans a majority in both the House and the Senate. Obama confronted two more years of complete inaction—a prospect he found unacceptable. If congressional paralysis continued, he promised in his last State of the Union address, then “Wherever and whenever I can take steps without legislation … that’s what I’m going to do.” He’s since followed through on his pledge with transformational and controversial policy reforms ranging from adopting measures to curb climate change to implementing a plan to protect up to 5 million immigrants from deportation. Cuba was next on the to-do list.

But domestic politics is only part of the story. The aging of the Castro brothers—Fidel is now 88, Raul 83—and the emergence of succession politics in Cuba contributed to a shift in the regime’s calculations. The graying of the Cuban exile population in the United States (whose median age is 40, compared with 27 for Hispanics overall) also created more favorable conditions for the deal between the U.S. and Cuba. In Florida, an older generation of Cuban exiles that was fiercely opposed to any liberalization in America’s Cuba policy has increasingly been replaced by a younger generation of Cuban-American voters who are more willing to explore alternative relationships between their old and new countries. The shift in attitudes is most apparent among second- and third-generation Cuban Americans, who arrived in the United States after 1980 in search of economic opportunity rather than in fear of political persecution, as was the case with many of the preceding waves of Cuban immigrants. These younger generations know that Cuba’s moribund economy desperately needs an overhaul. Few believe that Cuba will soon become a market economy or, much less, a democracy. But Raúl Castro has been explicit in his criticism of the country’s current economic model and has expressed a preference for a “Chinese approach” in which a more open economy coexists with a closed political system.

The Castro regime, however, has long managed to postpone these reforms, which would strengthen the economy but also constitute an admission that Fidel’s revolution had failed. And postponing this reckoning became possible thanks to the huge subsidies that Cuba received from Venezuela for more than a decade. That lifeline is now at risk.

Again, biology has intervened. President Hugo Chávez death from cancer in 2013 has stoked political instability in Venezuela, as his handpicked successor Nicolás Maduro has proven ineffectual in tackling the nation’s many problems and overcoming power struggles between different factions of Chávez supporters.  Venezuela’s economic collapse and institutional chaos was an important factor in motivating the Cuban regime to look for alternatives to Caracas’s largesse.

This would not be the first time that Havana successfully switched benefactors. In the early 1990s, the collapse of the Soviet Union created a painful economic crisis in Cuba. At the time, Russia’s nascent regime halted a subsidy ($5 to $6 billion annually) that had been keeping the island’s economy afloat. Many factors contributed to the Soviet Union’s demise, but among them was a steep decline in oil prices from 1985 to 1991, which meant a loss of approximately $20 billion per year—a severe blow to the Soviet economy that strengthened the hand of reformers in the country.

With Russia no longer willing to sustain Cuba’s economy, the island entered into a painful time of extreme economic austerity known as the “special period.” After a prolonged ordeal, in the early years of this century, Cuba ably created a replacement for its old Soviet benefactor: Chávez’s newly elected Venezuelan government. For almost a decade, Cuba has been receiving about 100,000 barrels of subsidized Venezuelan oil per day. Assuming an average price of $100 per barrel, this would amount to over $36 billion that the Cubans have been paying for in kind: Cuban sports trainers, doctors, security services, military training, and agricultural products cover just a fraction of what Venezuela could have earned by selling its oil in the open market.

But the oil market has changed. Prices have dropped to around $60 a barrel (down 50 percent since June). Weak global demand for energy compounded with a dramatically increased supply, thanks to new technologies like fracking in the United States, have battered countries like Venezuela that are dependent on revenue from oil exports.

The impact of lower oil prices on international relations is evident in Cuba’s new stance toward its northern neighbor. In the same way that it replaced the Soviet Union with Venezuela, Cuba is now hoping to replace the Bolivarian Republic with remittances, tourism, trade, and investments from the United States, its longtime nemesis.

What’s the upshot of the rapprochement between the U.S. and Cuba—the offspring of biology and technology? Cuba is unlikely to embark on a political opening any time soon, unless the current regime suddenly implodes. Cuba’s dictatorship has proven very resilient to political pressures, and systematically and brutally clamps down on dissidents. The government will surely try to maintain its chokehold on the population; at times, the repression may even become harsher as the need to reassert the regime’s power mounts. But in the long run, it will be hard for the Castro regime to maintain a tightly controlled political system if it allows more freedom of communication, travel, commerce, and investment. It’s easier to keep a lid on politics when a country is closed, hungry, and isolated than when it’s more open to the world.

In the aftermath of the agreement, the Cuban government will no longer be able to blame the island’s bankruptcy on U.S. policies. Throughout Latin America, the embargo has been perceived as a relic of heavy-handed U.S. intervention in the region. But that symbol is now fading for critics of the United States. If a closer relationship with America is good for its archenemy Cuba, how can it not also be good for other nations like giant Brazil or tiny Bolivia—two nations that have a fraught relationship with the U.S.? The unintended consequences of the deal are likely to be as surprising as they are varied.