A slow-simmering political crisis that has gripped Venezuela for months appeared to be coming to a head this week as opposition politicians issued a direct challenge to the authority of President Nicolás Maduro.

The leader of the opposition, Juan Guaidó, called for a military and popular uprising to oust Mr. Maduro from office, triggering a day of protest that turned violent but later fizzled. Mr. Maduro characterized the action as unconstitutional, while Mr. Guaidó maintained it was a necessary move to restore legitimacy to the presidency.

Both sides now seem to be scrambling for control, with Mr. Maduro appearing alongside troops on Thursday to reaffirm his status and Mr. Guaidó admitting he does not have the necessary support.

This week’s attempted uprising failed to change the status quo. But the confrontation has been years in the making, driven by an economic downturn and political discontent. Here’s what you need to know to understand how Venezuela came to this moment.