That's because su
asks for password of the user you're changing into (which by default is root password) while sudo
asks for your own user accountaccount's password and checks if you are allowed to run the command.
When you run sudo su
you are asking sudo
to run the command su
as root, which gives you the root shell. If you are using only su
you will have to know the roottarget user's password to have access.
Using sudo
without parameters implies that you want to use root. If you want to execute the command as another user, try sudo -u <username> <command>