Bit by bit, over time
And like many things, can be traced through history. But not all the history is clear cut, and much of that is no longer taught in schools and universities today.
For an entertaining and educational read I would highly recommend John Ross's "Unintended Consequences". Although it is a novel, there is a surprisingly large amount of history in it, along with many character's reactions to historical (as well as fictional) events.
Ok, fasten your seat belt (it's the law!) and get ready for the history lesson. And remember, you did ask for it.
There is no single point in time when this country woke up and said, "Gosh, people with guns are a bad thing", rather it built slowly and in increments, boosted from time to time by events and by deliberate actions.
Go back to the turn of the century (the 20th), and you see guns everywhere, even in the big cities, used for both protection and recreation. There were numbers of shooting galleries in major cities, it was a very popular pastime.
Jump forward a bit, and you get WWI. "The War to end all Wars". Add in both the shift from an agrarian society to a manufacturing society, waves of immigration from Europe, and then season with Prohibition. Mix and stir, then heat with the Great Depression.
Now you have a stew (the famous "Melting Pot") that begins to ferment gun control. The first major gun control laws affecting everyone (not just the racist "Jim Crow" laws) was the "Sullivan Law(s)". Sullivan was a major political figure in New York City, and in the 1920s he got laws passed that required a permit for carry (and a little later just for posession) of a handgun within the city limits. Then Prohibition, and the criminal empires it created. Gangsters with Tommyguns! War on the streets! The St. Valentine's Day Massacre! etc. etc.
Now the end of Prohibition (1933), and a lot of G men and T men are looking at being out of work. Along comes the NFA of 1934. Machine guns, silencers, stocked pistols, and short barreled rifles and shotguns (sawed off) are now illegal, unless registered with the Govt., and the ($200) tax paid. Remember, that is $200 in 1934. That is a lot of money for most folks, and so it wasn't a very popular thing to do. Instant job security for a lot of Federal cops. The groundwork is laid.
Now things get a huge push, the Second World War. We won, but the effort needed made a huge change in the social make up of our country. Many of the changes of the next 50 years can be traced back to things that got their start as a result of the war.
Through the 50s, things are still pretty good, shooting is taught in schools, the sight of someone with a gun is not an automatic danger signal, and common in the rural parts of the land. Any guns not restricted by the NFA of '34 are available to the public, by mail, delivered to your door if you want. Sold over the counter with no paperwork other than a sales reciept in virtually every dept and hardware store all over the country.
Then the 1960s. The asassination of JFK with a mail order rifle! The horror! And at this point, the Warren Commission report begins to open the rift between the (thinking) public and the Government. For the first time, large numbers of people begin to doubt the truth of what the Govt. tells us.
The murder of RFK a few years later puts the icing on the cake for the anti-gunners of the day, and the GCA 68 is passed. Firearms dealers now require a Govt license, and have to keep records. No more mail order guns for private (unlicensed) citizens. More rules about what is and is not a legal gun. "Sporting purposes" rules for imports. ID and record keeping requirement for ammo (later dropped). Age limits on purchases (18 for long guns, 21 for handguns). And some other stuff as well.
Lots of social turmoil in the 60s. Civil Rights. The Vietnam war. Free Love, Sex, Drugs, and Rock & Roll. Nixon. Kent State, etc. etc.
One result of this was a general disrespect for the Govt, and militarism. Serving your country was no longer a good and honorable thing in the eyes of many. Carry this through the 70s, with each new restriction creeping in, here or there.
Then comes the 80s. More change, more upheaval, and the anti-gun forces really shift into overdrive. The media becomes clearly, overtly anti gun. Time Magazine actually printed one editorial early on, declaring their position against private gun ownership. It was "too important an issue" for them to remain neutral.
The Regan shooting, and the tragic crippling of Press Secretary Jim Brady gave Sarah Brady her new mission in life. The one good law passed (GOPA 86) got stuck with a last minute amendment freezing the number of machine guns. No new ones allowed to be registered.
And then the Stockton school shooting, with an AK 47 lookalike. And other copycat shooting after that one. And all the while the media saying guns are bad, in both word and picture, for a couple of decades.
By the 90s, the media is going full tilt, and we get the AWB 94, banning a whole lot of things, but not one single assault rifle (as correctly defined, assault rifles are already covered under the NFA 34). 10 round magazine limit, and bans on certain combinations of features (folding stock, flash hider, bayonet lug, etc.etc.) The only good thing was the law included a sunset provision.
Things kept on this way, until 9/11. the single most horrific attack on America since Pearl Harbor, and worse in the sense that civilians were the target, and it was done without using any guns!
For a while, even the die hards in politics and the media stopped beating the gun control drum.
Today, the media is back at it, almost as bad as ever, and the entertainment side has their share of it as well. While constantly preaching "guns are bad", movies, TV, and video games constantly show people shooting other people, mostly with machineguns!
The devil is in the details, and I left out a lot more than I put in. Do some research, and be enlightened.