That's heavily dependent on which country you're in. In France[1] it can go up to 5 years in jail for refusing to provide a password. In the US[2], it seems that passcode are protected since you may be self-incriminating but FaceID, passkeys and fingerprints are not. UK seems to allow police to require you to give your password under their anti-terror laws.
[1] https://news.ycombinator.com/item?id=33550824
[2] https://www.selectlawpartners.com/faqs/do-you-have-to-give-p...