When farming became profitable in the Caribbean and the continental Americas, the slave trade saw a large number of Africans brought over as the primary workforce. A large Black population meant a large force to deal with if ideals of freedom–often wrapped up in rebellion–got around. To counter this and overall concerns of rebellion a new Royal Decree was drawn up. This was Real Cédula de Gracias de 1815 or the Royal Decree of Graces of 1815.
What this decree did was promote Spanish immigration to the Caribbean as turmoil was bubbling in its colonies. The superpower took a huge blow with Mexico fighting for its independence and making trade incredibly difficult. With trade throttled because of conflict, the decree was a preemptive step in other colonies.
Spain updated the decree fifteen years later. By this time it had lost Mexico and news of rebellion and independence was spreading. As a result, Spain opened its doors to non-Spanish Europeans. These newcomers were promised land and rights after a few year but they had to swear loyalty to the crown. This also meant that slave labor saw a significant bump at this time.
Because of the Royal Decree of Graces of 1815, an estimated 450,000 European immigrants arrived in the Caribbean during this period. They would marry those of the local population and become part of the political and cultural spheres in the Caribbean for the next century and beyond.
Ultimately, the decree was a gasping effort for Spain to hold on to what few colonies it had in the New World. It would lose the rest of its colonies as a result of the Treaty of Paris following the outcome of the Spanish-American War.