It was surely no accident that on Jan. 23, the Venezuelan opposition leader Juan Guaidó declared himself the country’s legitimate president. That challenge to President Nicolás Maduro occurred on the anniversary of a military coup in 1958 that ended a decade of dictatorship and ushered in an era of Venezuelan democracy and economic progress.

Venezuela’s military has long been a kingmaker at defining democratic moments. In addition to the 1958 coup, it helped to install a lion of Venezuelan democracy, Rómulo Betancourt, in the presidency in 1945 and was central to returning Hugo Chávez to office after he was displaced in a coup in 2002. That helps explain why Mr. Guaidó has appealed to the military by, for instance, persuading the National Assembly to pass an amnesty law for those who act “in favor of the restitution of democracy in Venezuela.”

Venezuela is not exceptional. In many countries, the military has played a critical role in establishing democracy. To be sure, it often exacts a steep price in the process, pushing for economic and institutional distortions to democracy that hamper its responsiveness to the will of the majority. In countries like Chile, Indonesia, Myanmar and Pakistan, coaxing powerful and entrenched militaries from power has required not just amnesty guarantees but also carving out economic domains for them to run autonomously and in many cases shunting profits directly to the military without any congressional authority to the contrary. Often these perks are then protected politically through constitutional provisions that grant outgoing authoritarians disproportionate political power or make the transition deal very difficult to overturn.

In Venezuela, Mr. Guaidó’s outreach, at least initially, was not persuasive: The defense minister, Vladimir Padrino López, flanked by Venezuela’s top military brass, publicly cast the military’s lot with Mr. Maduro. He proclaimed that Mr. Guaidó’s declaration represented a grave danger to national sovereignty and public order and that the military would remain loyal to the Constitution.