To understand better first of all I need to show you the Spaniard flag from the union between 2 crowns Castilla and Aragon . And from 1492 Spain began to use this flag , with different kingdoms symbols included
Attachment 50942
For the ships each ship had the flag from it patron or region with diferent flags
Some years later with the Spaniard empire the flag was white with a Red Cross
Attachment 50943
You can see this flag still in some ex Spanish colonies like Florida . This flag was still used in land until late xviii
After the secession war in the beginning of xviii century the flag used for the Royal Navy was the Bourbon king flag . Used with some variations in the navy ships . You can see this flag in the SOG model San Agustin. And yes in Spain the Navy is the Royal Navy too as we are a kingdom .
Attachment 50944
The flag was white and from far distances it was similar to other white countries flags , France ( before revolution ), Sicilia ...
So in 1785 the king decided to change the naval flag to recognize easily Spaniard ships .
There were some options
Attachment 50945
The king choosed this one , one for the navy and another one for the merchant vessels
Attachment 50946
Attachment 50950
This flag was used until XX . This is the flag for the navy on the napoleonic era. And it was used for land in the Peninsulan War in XIX century
In 1936 we had the republican flag
Attachment 50947
From 1939 to 1981 the flag was the franquist flag
Attachment 50948
And the democratic and actual flag . You can see in the actual coat of arms the different regions flags that were kingdoms in the past .
Attachment 50949