From trunk roads, main roads, and motorways, through to the tarmac ribbons in the countryside, the different sorts and standards of roads in Spain are owned and looked after by different levels of government.
Most of the roads operated by the national government are the ones that cross provincial and regional boundaries. This includes both motorways and conventional roads. The motorways are divided into two types: autovías and autopistas. There are technical differences between the two types of road (such as the style of junctions, width of carriageways, design speed, and the like), for most Spaniards, autovía is the all-purpose word for motorways, and they reserve autopista for toll motorways. For Brits the distinction might be that autopistas are motorways and autovias are major dual carriageways. Both types have a median separating the carriageways and at least two carriageways in either direction and the generic speed limit of 120 km/h.
The signs, direction signs, kilometre posts, etc., for these autovías and autopistas have a blue background and white lettering. Their road numbers start with an A or AP if it's a toll road. Roads which were toll roads but are now toll-free tend to keep the AP designation.
This blog explains more about their numbering.
The toll motorways were usually built as a partnership between public and private funds. The normal deal is that the constructor gets to maintain the road and charge a toll during the period of a temporary contract, typically 25 years. When the contract ends, the road becomes toll-free, and the title of the road falls to the government. Lots of toll roads have had to be bailed out of financial difficulties. During the current election campaign there have been several claims and counter claims that a general toll will be introduced on Spanish motorways from the start of January 2024. There's little doubt that tolls are coming, because Brussels is looking to recover some of the money invested, but the chance of it happening so soon are pretty slim.
The state's conventional roads, two-lane roads, one in each direction, often with a third uphill crawler lane on steeper sections, are traditionally called national roads. The generic maximum speed allowed on national roads is 90 km/h. In the Basque Country and Navarre, these roads are owned by the regional government. The signs, direction signs, kilometre posts, etc., for these roads have a red background with white lettering. The road number will begin with the letter N.
The same blog as mentioned above explains the road numbering system.
Outside the Basque Country and Navarre, the regional governments manage the roads that are within their territory. There are three classes or levels.
The first level comprises the most important roads in each autonomous community. They tend to be the busy, longer-distance roads within a region, and they can be either conventional or motorway-style. The signs, direction signs, kilometre posts, etc., for these roads have an orange background and black lettering. The road number will usually start with an identifier for the autonomous community. CV for the Comunitat Valenciana, RM for the Region of Murcia, etc. When one of these first-level roads is a motorway, the signs are sometimes blue, and some regions use a version that starts with A before the regional identifier (e.g., AG-59 in Galicia), but most seem to stick to the orange background and the regional initials.
The second level comprises "intercomarcal" roads, and they tend to connect towns or act as feeder roads to either the first-level roads or the national roads and motorways. The signs, direction signs, kilometre posts, etc., for these roads have a green background with white lettering. The letter (usually) corresponds to the province, and the numbers to the road.
The third level comprises local roads, which are usually short and link nearby localities or go to places of interest. The signs, direction signs, kilometre posts, etc., for these roads have a yellow background and black lettering that identifies the province or locality to which they belong and the number of the road.
Finally, there are the roads maintained by the local municipalities, which are very local roads and country roads within municipal borders. Usually, they don't have any sort of identifier except the signs which give the destination. There are, of course, exceptions. Some municipalities own and manage bigger roads, including motorway-standard roads, which usually have a letter for the municipality followed by a road number, such as the M30 in Madrid or the CT32 in Cartagena, for instance.
To cap off the signs you might see and to make sure that Big Chief I-Spy gives you due recognition, I should mention the European road network. These are the through routes across the continent. The signs, direction signs, kilometre posts, etc., for these roads add a green panel with white lettering to the existing road name, prefaced by the letter E.
And finally, just for completeness, I wanted to mention the roads which don't fit into this classification, particularly the roads run by the hydrographic confederations. If you drive across the countryside, you will come across these from time to time - usually, they are strange gated roads with dire warning signs set among acres of plastic sheeting or extensive crops. Ports and airports also maintain their own roads.