It's all economics.
Beginning in 1776, Spain gave a trading company money and critical military supplies to give to the American colonies. Spain also provided financing for the final Siege of Yorktown in 1781 with a collection of gold and silver in Havana, Cuba. Spain was allied with France through the Bourbon Family Compact and also viewed the Revolution as an opportunity to weaken their common enemy, Great Britain, which had caused Spain substantial losses during the Seven Years' War. As the newly appointed Prime Minister, José Moñino y Redondo, Count of Floridablanca, wrote in March 1777, "the fate of the colonies interests us very much, and we shall do for them everything that circumstances permit".
While the Spanish crown was hesitant to back the rebelling colonists, fearing it would set a bad example for their own American colonies, they viewed the revolution as a chance to deal a blow to the British Empire and strengthen the northeastern frontier of New Spain. Spain and Britain had been on opposing sides during the Seven Years War (1754–1763) — more commonly referred to as the French and Indian War in American History. At the end of the war, European claims of North American lands changed, with Britain claiming land from the eastern bank of the Mississippi River to Florida and Spain possessing Louisiana. Spain saw the revolution as a chance to gain control of both banks of the Mississippi River and reclaim Florida.
On July 21, 1779, Spain officially declared war against Great Britain and Louisiana Governor Bernardo de Gálvez, whom Galveston Island is named after, was commissioned to lead Spanish troops against the British throughout the Mississippi Valley and along the gulf coast. Gálvez, who had long been fearful of a British invasion of the port of New Orleans, was a staunch supporter of the British colonists and had been in communication with many leaders of the revolution. He and his uncle had also built up an extensive network of spies that was able to report on British movements in the gulf. From 1779 through 1782, Gálvez and his troops engaged the British army in battles from Baton Rouge to the Bahamas. The most notable of these battles was the successful capture of Pensacola in 1781.
One of the greatest challenges Gálvez faced was how to feed his troops. Early in his career Gálvez was stationed in Chihuahua, a state in northern Mexico near the province of Texas. While stationed in Chihuahua, Gálvez became aware of the ranches in south Texas and the large herds of cattle that roamed the territory. Gálvez, therefore, wrote to Texas Governor Domingo Cabello requesting cattle to feed his troops and authorizing a cattle drive from Texas to Louisiana. Prior to this it was illegal for Texans to export cattle to neighboring provinces, so this was the first official Texas cattle drive. In August 1779, 2,000 head of cattle departed La Bahia (present day Goliad) for Louisiana. From 1779–1782 between 10,000–15,000 head of Texas cattle were driven eastward to feed the Spanish forces engaging the British along the gulf coast.
The Spanish impact on the American Revolution was significant. First, Spanish troops forced the British to fight a three-front war, making it easier for the American colonists to be successful in their campaigns along the eastern seaboard. Second, as Spain gained control of the eastern bank of the Mississippi they were able to keep the Mississippi River, a vital transportation corridor, open to move desperately needed men, money and supplies for the rebelling colonists. Gálvez also helped to draft the 1783 Treaty of Paris that ended the war. Although Texas would not become a part of the United States until several decades later, Texas ranchers, and the cattle they provided for the war effort, played an important role in the success of the Spanish in their gulf coast campaign and therefore had an impact on American independence.
Gálvez requested to supply Spanish forces with Texas cattle so that they could eat and also fight. In addition to meat, Gálvez also helped get gunpowder, lead, and extra clothing up to American forces via the Mississippi and Ohio rivers. This would also force the British to expend man power and resources in fighting the Spanish.
From 1779 until 1782 over 10,000 head of cattle came from ranches connected to missions Bexar and La Bahia. Rancheros and vaqueros trailed the herds to Nacogdoches and Opelousas where they later distributed them to Gálvez's men.
The Spanish soldiers would defeat the British at locations in Louisiana, Florida and the Bahamas.
"Often we think of the Texas connection as being Anglo settlers in the early 19th century coming from the United States and bringing these revolutionary ideas and bringing their way of doing things, what we will and won't put up with from our government, and transplanting that to the western part of North America," Wright said.