Files created on NFS shares inherit the remote UID. By default, NFS enables “root squashing”, which maps UID 0 to the nobody user.
Root squashing can be disabled in /etc/exports with the no_root_squash
flag. This is obviously insecure, however, as it allows a user that connects to that share as root to drop SUID binaries! (Remember that files on NFS mounts are created using the UID/GID values of the local user!)