Both really
3 docs I'd say (if fully vaxxed):
#1 Spanish Health Control Form
#2 British PLF
#3 NHS Vaccine Cert (valid for a month or so?, so get a new one for each trip)
You need to fill a #1 Spanish Health control from within 48 hours of leaving. (You can start it before then, but only fill in the last part within 48 hours) If fully vaxxed then you'll need your #3 NHS Vaccine Cert in order to fill in the Spanish Form. The Spanish form will be checked at the airport in Spain, as Batch said paper is easier!
You need to fill in a #2 British PLF form within 48 hours of coming back (again, if vaxxed then your #3 Vaccine cert is part of that).
The only other thing is that your airline might also ask you to upload some of these docs before you can check in online.
This can be a bit of a pain, BAs IT (unsurprisingly) was shite, this was their system:
1 Spanish Govt requires you to fill Spanish Health Control Form before travel; successful completion of this form generates a QR code. ‘Seat Number’ on plane is a mandatory field on this form.
2 BA require you to upload a completed Spanish form & QR code onto their website prior to flight, you cannot check in online for the flight until you have done so.
3 You don’t get a Seat Number until you check in.
Great system… Got round it by putting a dummy seat number in (99L) which I found in the FAQs. Other airlines are (probably) better.