A tarball is a single archive file bundling many files, and it is the format npm uses to publish packages. The name comes from the tar tool, and the archive is usually compressed. When a package is published or installed, its contents travel as one such file.
It matters for security because the tarball is the thing that is actually installed, and it can differ from what is shown in a project's source repository. A package's published contents may include files that are not in the public code, so inspecting the repository alone does not show what users receive.
A tarball does not by itself prove where it came from or who built it. Checks such as comparing hashes, using lockfiles and verifying provenance records help connect the file with the source. Tools can also list or unpack a package's contents without running anything.
To examine a package safely, download and inspect the tarball without installing it, compare it with the source repository, and be cautious about packages whose contents contain unexpected files or scripts.