NICS is an instant criminal background check administered by the FBI.
When you purchase a firearm, the dealer takes your identification information and calls the FBI with it. The FBI informs the dealer whether or not you are prohibited from owning a firearm.
By law, they are not supposed to keep any record of the firearm you purchase.
That’s the theory of it. It’s not uncommon for govt agencies to be non-compliant w/ the law.