The way I've seen this done is usually to outsource it to some third party like
https://network.id.me/platform/identity-verification/ that does the verification by proxy, handles all the compliance and privacy stuff, and then tells the website operator "this user is verified as a _______".
I don't think your documents get shared with the website directly, just your verification status, but I'm not 100% sure about that.
And I think the verification process mixes and matches ID checks, employment records, credit records, text messages, etc., kinda like how a bank asks you "Which of these streets, if any, did you ever live on?". There are different questions for different kinds of verifications.