This is more to do with ABM - you can add a device to ABM that wasn’t put there by a reseller/vendor/Apple. This also enrols the device, and removing the enrolment in the first 30 days also removes it from ABM again.
After the 30-day period, the enrolment profile cannot be removed on the device-side. This workflow applies for both iOS and macOS.