When the Bourbon dynasty took the Spanish throne in 1700, and especially after Charles III came to power in 1759, Spain set out to overhaul its American empire. New Spain, the viceroyalty stretching from Central America to the northern borderlands of today's United States, was the jewel of that empire, and the Bourbon kings wanted more of its wealth and tighter control over its government. The shock of the Seven Years' War, when Britain seized Havana in 1762, convinced Madrid that its colonies had to be defended and taxed far more effectively.
The reforms touched everything. Charles III's inspector-general José de Gálvez spent 1765-1771 in New Spain reorganizing tax collection, establishing royal monopolies on tobacco, gunpowder, and playing cards, and raising revenue sharply. The old system of governing through officials who had bought their posts, many of them American-born creoles, was replaced by the intendancy system introduced in 1786: salaried provincial governors sent from Spain. The crown created a standing colonial army of regulars and militia, promoted mining with a new code and technical schools, and in 1804 even ordered the wealth of the colonial church funnelled to the royal treasury through the Consolidation decree.
The most famous reform was the expulsion of the Jesuits in 1767, when thousands of members of the order were deported from Spanish America and their missions, colleges, and estates seized. In New Spain's far north the crown filled the vacuum by reorganizing the frontier as the Commandancy General of the Interior Provinces in 1776, and Franciscans took over mission work, including the chain of missions founded in Alta California from 1769. Commerce was liberalized within the empire by the 1778 free trade regulations, and Veracruz boomed as silver exports climbed to record levels.
The reforms worked too well for Spain's own good. Revenue from New Spain soared, but creole elites, shut out of high office by peninsular Spaniards and hit by new taxes, grew resentful; the expulsion of the Jesuits removed both schools and defenders of the crown; and the new militias trained the very men who would fight in the wars of independence. When Napoleon's invasion of Spain in 1808 decapitated the monarchy, the imperial ties reformed so tightly snapped within two years in a struggle that began at Dolores in 1810.