How do 3rd-party programs modify the $PATH variable?
You can check the content of /etc/paths and the files in /etc/paths.d which gets added to PATH by

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi


in /etc/profile (or /etc/zprofile). Run /usr/libexec/path_helper -s to see what it does.