Is the PIN a software lock or is it replacing the master password at local?

How does the PIN work?

Is it at the software level where it’s not encrypting anything and only a simple prompt is keeping someone out or is the PIN replacing the master password at the local level?

I know the PIN is not a replacement for the master password but how does it work? Is the PIN safe to use?

The PIN is implemented at local level. You can use different pins for each device.
Bitwarden only decrypts the vault when needed. Otherwise, the vault is encrypted and stored in the memory.

But is the PIN a software lock or is it replacing the master password and encrypts the encryption key locally?