The answer to this is SCIM, which allows an app to sync the user state with the identity/directory system.
IT admins call this "User Lifecycle Management" and it's typically a required feature for enterprise-scale customers.
(I work at WorkOS and we help developers with this: https://workos.com/directory-sync)