[1] https://developer.apple.com/documentation/security/password_autofill
[2] https://developer.apple.com/documentation/security/password_autofill/about_the_password_autofill_workflow
Not sure whether that's 100% relevant, but could be a starting point?
Quoting from [2]:
Security code. If the system can parse a security code from an SMS message, the QuickType bar shows the code for up to three minutes after it has been received. If a security code arrives while the text input view is selected, the system pushes the incoming code to the QuickType bar.
To test the format of your SMS code for different languages, text a message to yourself. If you receive a message with an underlined security code, tap on the code. If a Copy Code option appears, the system has recognized your code.
Doesn't sound too far off, does it?