It’s known as subrogacion.
Benefit is you save on some costs such as valuation fee, opening commission, notary, tax & registration fee.
Downside is you normally pay 1% as a subrogacion fee and of course you take on the seller’s mortgage which may or may not be as competitive or the terms you want etc.
Make sure you obtain a copy of the mortgage deed and read it carefully or get yourself a solicitor etc