It uses hardware with a secure element only permitting 20 attempts. The past 5 unique attempts are rejected early out for usability.
We published a technical overview of how GrapheneOS protects against data extraction covering the major protections it adds:
https://discuss.grapheneos.org/d/40700-grapheneos-protection...