Both paintings were completed in a two-month time frame in 1814. Today they are displayed in Madrid's Museo del Prado.
Goya witnessed first-hand the French occupation of Spain in 1808, when Napoleon used the pretext of reinforcing his army in Portugal to seize the Spanish throne, leaving his brother Joseph in power. Attempts to remove members of the Spanish royal family from Madrid provoked a widespread rebellion. This popular uprising occurred between the second and third of May 1808, when suppressed by forces under Maréchal Joachim Murat.
The Second of May 1808 depicts the beginning of the uprising when the Mamelukes of the French Imperial Guard are ordered to charge and subdue the rioting citizens. The crowd sees the Mamelukes as Moors, provoking an angry response. Instead of dispersing, the crowd turned on the charging Mamelukes, resulting in a ferocious melee.
Goya was probably not present during the actual Charge of the Mamelukes. His supposed presence was first suggested in a book published 40 years after his death, reporting on conversations the author claimed to have had with Goya's gardener. His paintings were commissioned in 1814, after the expulsion of Napoleon's army from Spain, by the council governing Spain until the return of Ferdinand VII. He chose to portray the citizens of Madrid as unknown heroes using the crudest of weapons, such as knives, to attack a professional, occupying army. That did not please the king when he returned, so the paintings were not hung publicly until many years (and governments) later.
Goya chose not to paint any single action or to have any single focal point to emphasize the chaos of the drama.