The recovery key for 2 step verification for your AppleID is something you generated when you enabled 2 step verification. As told to you then in the messages during setup, you needed to record that number and keep it somewhere safe as you cannot recover an AppleID under 2 step verification without it.
Two-step verification for Apple ID - Apple Support
“You'll also get a 14-character Recovery Key to print and keep in a safe place. Use your Recovery Key to regain access to your account if you ever lose access to your trusted devices or SMS-capable phone number, or forget your password.”
and
”Where should I keep my Recovery Key?
Keep your Recovery Key in a secure place in your home, office, or other location. Consider printing more than one copy, so that you can keep your key in more than one place. Your key is easier to find if you ever need it, and you have a spare copy if one is ever lost or destroyed. You shouldn't store your Recovery Key on your device or computer, because that could give an unauthorized user instant access to your key.
If you ever need a new Recovery Key, you can create one from your Apple ID account page. Just sign in with your password and trusted device, go to the Security section and click Edit, then click Replace Lost Key.
After you create a new key, your old Recovery Key won't work.”
The 28 character recovery key for AppleIDs under the newer 2 factor authentication system is something new with iOS and iPadOS 14.