Overall, that’s how it is. Before selling a Mac, iPhone, or any other device, you don’t need to take special actions. I don’t know about computers and laptops with Windows, etc., but on a Mac, it’s very simple to do, literally by just clicking one button. There’s also a recovery mode
https://setapp.com/how-to/use-recovery-mode-on-mac, which cleans the entire Mac and brings it back to a state where it’s ready for a new user without any threat of spreading your personal data.