Every app has access to an api that asks your phone to verify your fingerprint against the ones stored for the lockscreen. The phone then asks for your fingerprint and tells the app if it passed or not.
As the commenter pointed out, it’s not an image of your fingerprint either. It’s a hash that is stored on your phone that is likely unique to that device.
I think it’s literally a Grammerly addon (but I’m not OP)
I’d be interested in one for LanguageTool instead