If one moves to Spain then they are required initially to register the licence and then after a maximum of two years exchange it for a spanish one
So far so good
However, if living outside U.K. one cannot renew/ replace a U.K. DL in U.K.
If one loses, accidentally destroys, or has their non Spanish DL stolen ( I know that from working at a police station, it is not that uncommon) they cannot get a replacement from say U.K. as they do not live there and they cannot drive in Spain without having a valid DL in their possession. Thus they would need to apply for a Spanish DL. At present that can take up to six months to get an appointment, and they cannot legally drive in the interval.
A Spanish DL can be replaced fairly straightforwardly. See here, in English :-
https://sede.dgt.gob.es/Galerias/tramit … cir_EN.pdf
Suggestion; If you come to live in Spain exchange your DL as soon as possible