Every state has their own rules, but generally speaking there are licenses for (1) gun dealers, (2) gun manufacturers, and (3) gun importers. There are also permits for "concealed carry."
But to buy a weapon there's usually no license requirement. There's a background check requirement, but in most states this only applies when you buy a gun from a federally-licensed firearms dealer. If you buy a gun from a private citizen there is usually no background check requirement.
These private gun sales often take place at gun shows. While most of the guns at these shows are sold by federally-licensed dealers, there's always a handful of private citizens who set up a booth and sell to anyone who can pay. Also, these transactions almost always take place in cash meaning there's no way to trace the gun back to the manufacturer or dealer.
This is "the gun show loophole," but that name isn't really accurate because these private sales can take place anywhere - even outside of gun shows.