Many people in abusive situations have very limited opportunity to use computers, and may well not have time to learn about things like "tab close" actions. This doesn't stop people who do know about those shortcuts from using them.
https://design-system.service.gov.uk/patterns/exit-a-page-qu...
Government sites that use this component will include a page that explains this feature and how to use it, they have considered this. This is generally used on flows/pages, where the site is walking you through a proccess or a guide.