Few people around the world are more keenly interested in the health of cancer-stricken Venezuelan President Hugo Chávez than a pair of brothers in Cuba: Fidel and Raúl Castro.Since becoming president of Venezuela in 1999, Mr. Chávez has developed an exceptionally close bond with Fidel Castro, who has served as the Venezuelan’s mentor, medical adviser and father figure. The personal relationship between the old dictator and his younger autocratic pupil has evolved into a web of economic and political ties that today bind together the destinies of the two countries. It has given the poor, almost bankrupt island enormous power over its far wealthier and more populous oil-producing neighbor.Cuba, ruled by the Castro brothers since 1959, has a lot to lose if Mr. Chávez dies. Since 2007, Venezuela has provided the Communist island nation about $10 billion a year in economic aid, mostly in the form of cut-rate oil and inflated payments for thousands of Cuban doctors and other professionals, according to the University of Miami’s Cuban-studies center. Total aid and investment from Venezuela now amount to about 22% of Cuba’s annual economic output, said Carmelo Mesa Lago, a professor emeritus at the University of Pittsburgh.If the relationship between Havana and Caracas were to end or falter, many Cubans fear that the island’s threadbare economy could be pushed into depression, as in the early 1990s, when Cuba lost Soviet aid and its economy plunged by about 40%. "It could lead to a social upheaval," said Riordan Roett, the head of Latin American studies at Johns Hopkins University.In February, after Mr. Chávez had spent two months in Cuba’s best hospital recovering from his fourth cancer surgery in 18 months, the ailing president was flown back to Caracas in the middle of the night and spirited off to a military hospital. His prognosis is a state secret, but most analysts believe he is fighting a terminal disease.If Mr. Chávez dies, Venezuelan law calls for new elections. The country’s political opposition has long railed against the aid to Cuba, promising to spend Venezuela’s oil money at home.The elder Castro has for years been Mr. Chávez’s top adviser on the art of political survival, analysts say. The two countries have signed more than 300 trade and economic cooperation deals, many of them involving barter arrangements that appear to favor Cuba."Since when do poor countries run rich countries, small countries run big countries and weak countries run powerful countries?" asked former Mexican foreign minister Jorge Castañeda. "It’s as if Puerto Rico ran the U.S. It’s crazy."The bond between the two countries is unprecedented in Latin American history, said Carlos Alberto Montaner, a Cuban-born political analyst based in Miami. In 2004, they even considered a formal merger, he said. Venezuelan wags joke that their country’s name should be changed to "Cubazuela."The relationship began on the tarmac of Havana’s airport in 1994. Mr. Castro had exercised absolute power for 35 years. Mr. Chávez was a skinny, unknown lieutenant colonel, a failed coup leader. He had just been released from prison, pardoned after serving two years for rebellion.Mr. Castro, angry at the Venezuelan president for giving an audience to a Cuban exile leader, rolled out the red carpet for Mr. Chávez, providing him with honors usually reserved for a head of state. During the two-day visit, Mr. Castro was constantly at his side, staying up all night for long conversations. The men bonded over their love of baseball and windy monologues, resentment of American hegemony and a lust for personal power. "Fidel saw that Chávez was a diamond in the rough, and he started to polish him," says a former Chávez cabinet member.Once elected president in 1998, Mr. Chávez became Mr. Castro’s closest ally. Mr. Chávez saw in Mr. Castro a father figure and a way to gain revolutionary respectability. Former Venezuelan officials and analysts say that Mr. Castro saw Mr. Chávez as a politically naive mark—a source of largess who could help the savvy dictator continue his work of challenging the U.S."It’s a very cold political-strategic calculation," said Brian Latell, a former CIA Cuba analyst and biographer of the Cuban leader. "But Fidel is a great performer. Chávez could easily be convinced that he loves him."Fidel Castro’s interest in Venezuela, and its oil, predates Mr. Chávez by 40 years. Just weeks after toppling Cuban dictator Fulgencio Batista on New Year’s Day in 1959, Mr. Castro flew to Caracas on his first foreign trip. He was given a rapturous welcome by tens of thousands of Venezuelans, who a year earlier had overthrown their own dictator.According to British historian Hugh Thomas, Mr. Castro met with Venezuelan President Romulo Betancourt and asked the Venezuelan to help him out with a $300 million loan and oil to finance Mr. Castro’s planned "game with the gringos." Mr. Betancourt declined and was quickly placed at the top of the bearded revolutionary’s enemies’ list.Mr. Castro was soon trying to overthrow Mr. Betancourt, backing Venezuelan guerrillas in a bloody insurgency. In 1963, John McCone, then CIA director, testified to Congress that there were at least 200 Venezuelans undergoing military training in Cuba, by far the largest group of guerrillas from any Latin American country. Mr. Castro sent some of his most able officers to help the insurgents, sponsoring at least two small-scale guerrilla landings in Venezuela in 1967."I think Fidel was always thinking about the oil," said Mr. Latell. "After all these decades, he got the payoff."The relationship deepened in 2000 when Mr. Chávez, as president, invited Mr. Castro to Venezuela to visit his dusty hometown of Sabaneta. "Chávez, just think, in 100 years, Venezuelans will be making pilgrimages to this house," Mr. Castro said as they viewed Mr. Chávez’ tumbledown childhood home, according to former interior minister Luis Miquilena, who was on the trip.During that trip, Mr. Chávez signed the first oil deal with Mr. Castro, providing Cuba with 53,000 barrels per day of cut-rate oil, a sum that has risen to 110,000 barrels today. In return, Cuba has sent some 40,000 doctors, dentists, sports trainers and other experts in fields ranging from agriculture to telecommunications. The doctors, who provide free health care in Venezuela’s impoverished barrios, are enormously popular and have helped to sustain Mr. Chávez’s mass appeal.But the relationship has proved costly. Many Venezuelans grew alarmed when Mr. Chávez said in 1999 that Venezuela and Cuba were swimming together toward "a sea of happiness." By 2002, Mr. Chávez’ rhetoric of class warfare and his determination to implant Cuban-style education and agricultural policies had divided the country. In March, army generals defied Mr. Chávez’s order to fire on anti-Chávez demonstrators headed toward the presidential palace and forced Mr. Chávez to resign.Mr. Chávez was taken to a naval base on an island and seemed headed to exile in Cuba. But Mr. Castro talked by phone to Mr. Chávez, urging him "not to quit, not to resign," as Mr. Castro told a Spanish biographer. He also cajoled fence-sitting Venezuelan generals to restore Mr. Chávez to office. Backed by the army, Mr. Chávez made a triumphant return to the presidential palace two days later. Mr. Chávez never forgot this service."Chávez was wavering, cowering," said Mr. Latell. "Fidel helped to boost him by getting on the phone with the Venezuelan military. Chávez owes him an enormous debt of gratitude."By most accounts, Mr. Chávez has handsomely paid off that debt.