It's encoded in a language (lean) and if the language's type checker is correct, and the code doesn't exploit any issues in the type checker, and the proof type checks, we know the proof is true. So you'll use multiple independent type checkers (lean kernels), some formally verified, check the code for exploits etc, and work towards confidence that the theorem prover is valid, which means (from math that's already understood) the proof encoded with the theorem prover is valid. You also check if the statement in lean of what the model proved is equivalent to the question you were actually asking (for stuff like Riemann there's commonly accepted/vetted definitions in lean).
So you can know that the proof is valid without knowing why it is valid.
Meaning, yeah, it's impossible to know a proof is correct without no understanding and no verification. But those two are not the same thing. The proofs are verified but we don't understand them