Most juntas were created out of the already-existing ayuntamientos (municipal councils) with the addition of other prominent members of society.
Juntas emerged in Spanish America as a result of Spain facing a political crisis due to the kidnapping and abdication of Ferdinand VII and Napoleon Bonaparte's invasion.
Once Popular sovereignty was adopted in the Spanish Empire there was a conflict between those who wanted unity or independence.
The juntas did not accept the Spanish regency, which was under siege in the city of Cadiz.
In the end, the triumph of the republican ideas such as Bolivar's were imposed over Constitutional monarchy as San Martin's proposed.