Subdomain takeovers occur when your subdomain points a webpage that is not exist anymore. Attackers use this to takeover your subdomain.
If your subdomain pointing a non-exist webpage, an attacker can claim that page by adding CNAME file containing your subdomain address which results in gaining control of your subdomain.
If the subdomain takeover is successful a wide variety of attacks are possible (serving malicious content, phising, stealing user session cookies, credentials, etc.).
To protect from subdomain takeover attacks, the digital footprint DNS records should be properly monitored and analyzed. Cleaning old CNAME records should be automated and the DNS zone file should be kept up to date.