In short: Spain has public healthcare (Social Security / health card) and private health insurance. For some visas private insurance is mandatory (especially non-lucrative residence and students). As a complement (speed, specialists) it's optional. Contracted online or by phone.
First, do you have public access? If you work and contribute, you and your family have public healthcare. Without work access, many regions let you pay the convenio especial (monthly fee to use the public system). Check the health card first.
When private insurance is MANDATORY:
- Non-lucrative residence: private health insurance with full cover in Spain, no copays and no waiting periods, with an authorised provider. It's a visa requirement.
- Students / other visas: health insurance is usually required for the stay.
What it covers / how to choose:
- Medical network (cuadro médico) vs reimbursement (any provider, % refunded).
- With/without copay — pay per visit or not.
- Waiting periods (carencias) — months before certain cover applies (childbirth, surgery…). For a visa: none.
- Common insurers (among others): Sanitas, Adeslas, DKV, Asisa.
What you need as a foreigner: NIE/TIE or passport, address. For a visa, ask the insurer for a certificate stating expressly "full cover, no copays and no waiting periods".
Common pitfalls: buying a cheap policy with copay/waiting periods that doesn't qualify for non-lucrative; not requesting the certificate for the consulate/immigration; forgetting that public cover may suffice if you contribute.
Informational, not medical or insurance advice. Check exact visa requirements with the official source and a professional. Legal reference: RD 557/2011, art. 62 — BOE-A-2011-7703. Visa requirements: non-lucrative residence — Migraciones.