In 1803 Spain and France where allied but as Spain keept shifting sides the French and some Spaniards made a popular coupe (since even the people where tired of the king) in favor of his son however Napoleon did not trust the new king and installed his brother instead and since Napoleon had about 100,000 troops in Spain at the time, the people couldn't do much other than protest until they started their guerrilla warfare that is.