The two-step confirmation (two-factor authentication) prevents your SIM card or copies of it from being used to access your messages.
More information
In some messengers, this works via email. In others, you can assign an additional pin. If you lose your phone number or other people or authorities get hold of your SIM card or a copy of it (sim swapping), they can log in with the phone number and read your messages or write in your name.