OK, short explanation: if you switch to root using
su
the root session uses your user’s PATH, HOME etc environment variables.
If you switch via
su -
it resets the environment variables and uses the ones for the target user (in this case root)
Excerpt from su’s man page:
-, -l, --login
Start the shell as a login shell with an environment similar to a real login:
o clears all the environment variables except TERM and variables specified by --whitelist-environment
o initializes the environment variables HOME, SHELL, USER, LOGNAME, and PATH
o changes to the target user's home directory
o sets argv[0] of the shell to '-' in order to make the shell a login shell