These apps can be installed on your phone (Authy can also be installed on laptops and desktops) and generate a random 6-digit code that changes every 30 seconds for each account that you link to the app.
When you sign-in to your account, as well as your username and password, you’ll be asked for the current 6-digit code for that account. That tells the service that you’re logging-into that you have that second piece of identity verification i.e. you have your phone with you, and so is a more secure way of signing-in.
In other words, anyone trying to log-in as you without your phone wouldn’t be able to.
Bear in mind, with the exception of Authy (which you can sync across multiple devices), if you change your phone, you will also have to link the accounts in the new app on the new phone before you get rid of your old one, otherwise you won’t be able to sign-in to any of them.