As in the UK, most Spaniards are covered for health treatment by the public health system but many take out private insurance, using the state health services for emergency purposes only as there are waiting lists for operations in the state services though these are not as long as in the UK.
The Spanish health system combines both public and private healthcare and within each separate state free or low cost health care is given to those who contribute to the Spanish Seguridad Social (social security). Everyone who lives and works in Spain is required to have a Social Security number for entitlement to government pensions, sickness, unemployment and healthcare and if you move to Spain permanently, you need to apply for an official medical card at your local
Seguridad Social (Spanish Social Security - SS) office.