Many people are shocked when they find out there is a process by which civilians in the US can purchase and possess machine guns. Due to how the country operates manufacturing, we need these provisions. There needs to be a system by which we can permit civilians to possess all classes of firearms.
Unlike communist countries or more totalitarian regimes, the government in the US doesn't control the production of goods. In fact, the government provides very few goods for itself. Most of what it uses is designed, developed and manufactured by private companies. Whether it's light bulbs, pencils, computers, automobiles, buildings or military hardware, the process is the same. The government agency accepts bids to provide goods at a set specification. Private companies compete for these contracts to sell goods to the government agencies.
Why does this process have to do with your neighbor being able to buy a machine gun? Well, all those private companies are owned, run and staffed by regular citizens, like your neighbor. Maybe even you. Maybe you work for a company that makes pencils, or automobiles or parts for tanks. Maybe you work for Boeing and you make fighter jets. Maybe you work for Colt and you make M-16's.
Due to this, there needs to be a system in place where civilians and corporations can be in possession of things like tanks, missile systems and machine guns. Somebody has to design them, make them, warehouse them and ship them. When it comes to firearms the regulations surrounding them are defined in the National Firearms Act which entered into law in 1934. Believe it or not before that law passed you could buy a Tommy Gun from the Sears catalog. They were advertised as being good for pest control.
The National Firearms Act (called NFA) created classes of firearms that are now regulated. Regulated in this case means a civilian can't go into a store and just purchase one as they would any other firearm. They have to navigate a process to manufacture or possess an object regulated by the NFA. These items include Short Barreled Shotguns (a shotgun with a barrel less than 18"), Short Barreled Rifles (any firearm with a stock and a barrel of less than 16"), Silencers, and Any Other Weapons (an arbitrary list of guns and other weapons).
In order to manufacture or possess one of the objects regulated by the NFA a civilian (or company) has to file forms, photographs and fingerprints with the BATFE which conducts a background check before they approve them. The forms have to be signed off by the Chief Law Enforcement Officer (CLEO) where the civilian lives, which is either the Chief of Police or Sheriff. There is also a $200 tax stamp that must be purchased. Remember in history class when you read about tax stamps? They are still used as a part of this process.
If a civilian navigates that process they can be approved to possess something regulated by the NFA including a machine gun. The interesting part is this includes being able to manufacture a regulated firearm, except for a machine gun. Congress passed a law in 1986 that no new machine guns could be manufactured and added to the NFA registry. So the only machine guns that can be purchased by regular civilians are those that were made prior to 1986. Due to a frozen supply and ever increasing demand, these guns are quite expensive. By quite expensive I mean many cost more than you paid for your car. This is a limiting factor in itself, as is the processing time, which at the time of this writing is often 9 months or longer to process paperwork.
The other way a civilian can be in possession of a NFA regulated object is by obtaining a Class 2 or Class 3 Federal Firearms License (FFL) as a Special Occupational Taxpayer (SOT). In common parlance a dealer is referred to as a Class 3 dealer, where in ATF terms they are a Type 1 or 7 FFL with a Class 3 SOT that allows dealing in Title 2 firearms. But nobody talks like that outside of people inside the firearms industry. These are the licenses required for companies or individuals that engage in the business of manufacturing or selling NFA regulated items to government agencies that are permitted to own them.
If your local police department decides they need some machine guns for their SWAT team to combat drug lords, they have to buy them from somewhere. That somewhere is a Class 3 FFL. The class 3 FFL needs to purchase them from a company or individual that manufactures them, which is a Class 2 FFL. Some companies may possess both a Class 2 and 3 license, but in today's world distribution is often handled by a different company than manufacturing.
Lots of innovation comes from very small companies, individuals or one-man shops. You'll find people tinkering in their basements and garages trying to come up with the next product all over the world. Those people may be working on computer software, making parts for wind turbines or working on a recoil system on a firearm they hope the army will adopt. Here is an article describing how the 1994 Assault Weapons ban hurt that innovation and put soldiers at risk. This is why we need a permit and license system to allow for that innovation, and it's rational that civilians should be allowed to possess machine guns, whether you think that's something covered under the second amendment or not. How we run industry in this country requires a permit system for companies to design, manufacture and posses all classes of firearms, whether that company has 1 employee or 100,000 employees.
BATFE regulations are stirringly complex, but if you'd like to read more about the regulations involving all types of firearms, you can find that here.