Here in Maryland, here are the laws that govern buying a handgun:
1. First, if said handgun was made after January 1, 1985, it must be approved for sale in Maryland by the Handgun Roster Board, a panel appointed by the Governor which decides whether a given gun is safe enough to be sold here. (This was the result of a "Saturday Night Special" law.) Many firearms which are commonly available in other states are banned from sale here because the Handgun Roster Board has not approved them.
2. You must have a Handgun Qualification License issued by the Maryland State Police (MSP). As previously noted in this thread, you must be fingerprinted, and the total cost for this is around $100.
3. All handgun transfers, even between individuals, are subject to a seven-day waiting period and background check by the MSP. There is a $10 charge for the background check.
4. When transferring a handgun, you must complete MSP form 77R, which is several pages. You must answer questions similar to the federal form 4473, plus submit detailed personal information. The dealer must submit the firearm information: Make, model, serial number, etc.
5. If the firearm is new, it must have a fired shell casing packed with it, so the gun can be registered in Maryland's ballistic database.
6. If the firearm was made after December 31, 2002, it must have an 'integrated mechanical safety device'. Several years ago, the Handgun Roster Board ruled that the Omega Lock and similar devices qualify as 'integrated', otherwise very few new handguns could be sold here.
7. You can buy only one handgun per month, unless you have sought and received designation as a 'collector' under Maryland Law.
For many years, so-called 'assault weapons' were regulated under the same law, but two years ago, the General Assembly banned them altogether. So, today in Maryland, it is illegal to transfer any M1-A, AR-15 (except HBAR models), any AK-platform gun, etc. If you own one of these, you can keep it.
Magazines over ten rounds capacity are banned for sale. If you own them, you can keep them.
For such a small state, Maryland is very culturally and geographically diverse, with 23 counties and the City of Baltimore (which is not part of any county). You can drive from the Atlantic Ocean to the Appalachian Mountains in half-a-day. We have watermen on the Eastern Shore (the peninsula between the Chesapeake Bay and the Atlantic Ocean), coal miners in Western Maryland, farmers in the rural areas of Central Maryland, and government employees in the urbanized areas around Baltimore and Washington. There are many parts of this state where violent crime is rare. The majority of 'gun violence' occurs in the City of Baltimore, and one or two of the counties in central Maryland, and it's concentrated among certain elements of our population. Yet, instead of addressing the problem directly, our leaders always turn to new gun laws as the solution to violent crime. It's ineffective, but it's what they do here.