You don't install a tar file. A tar file is just an archive full of other files, which could be anything (music, movies, data files, etc.). It's similar to a zip file.
What UID/GIDs get "stripped out"? Is it changing the permission of your existing files? Or are you just curious why the extracted files belong to a different user?
From the tar man page:
try extracting files with the same ownership as exists in the ar‐
chive (default for superuser)
extract files as yourself (default for ordinary users)
So the reason it's preserving the owner is because you're extracting as root, which is generally not a good idea, since you don't know what could be in that file. Either way, root can still use the files regardless of their owner, because it's root. If you don't want to keep the original owner, then set the --no-same-owner flag in tar. And regardless, you can always just chown/chmod the files/dirs after they're extracted to change them to whatever you want.