Once you are on the Padron, you will get emergency treatment in any public hospital in Spain as it takes over from the EHIC which is really designed for tourists. If you take out residency, you will need to be either employed or self-employed and pay social security contributions to get free healthcare. This is the only way to get a Spanish national insurance number which puts you on to the system. If you have a job, get an insurance number and then become unemployed, you will still get medical treatment as you will still have the insurance number.
If you intend to move from UK on a permanent basis and are under retirement age (still 60 and 65 for women and men) you must apply for an E106 which will give you up to 2 years free cover in Spain depending on NI contributions you made in UK. If you were unemployed in UK you will also get the 2 years free cover. Getting the E106 does not take you off the NHS in UK and you can still access UK facilities. Once the 2 years is up, you will need to take out private insurance to get non-emergency treatment.
If you have a UK state pension (disability, incapacity, retirement) you need an E121. This will give you immediate access to the Spanish NHS when you register with a doctors. The E121 removes you from the UK NHS system and you will not (officially) be allowed access to UK facilities.
To apply for the E106 or E121, look at previous threads as I think the phone numbers and contacts are still valid.
The EHIC is valid for visits of up to 90 days and will cover you for emergency treatment but not ongoing medical conditions.
You can receive a computer printout of your medical records from your GP in UK for a cost of £10. If you want a complete record going back a long time and have lots of letters etc, the GP can charge up to a maximum of £50 depending on the amount of records, however, the computer printout should suffice as these will go back at least 13 years and will include details of all your medical problems, hospital procedures and medication.