There are three ways to get a device identity:
Microsoft Entra registration
Microsoft Entra join
Microsoft Entra hybrid join
Microsoft Entra hybrid joined in Managed environments
Pending devices in Microsoft Entra ID
There are two scenarios in which a device can be stuck in a pending state.
Sync a new on-premises domain joined device to Microsoft Entra ID
The state of a registered device is changed to pending