Any activity, including backlinks and website built on a domain previously is known as domain history.
If a previous website on a domain received a penalty this will remain attached to the domain and cause issues for the new owner.
It’s recommended to always check the domain history before you purchase a domain.