Stock Sales are normally done with large corporations where there are many shareholders and are seldom seen in smaller businesses. In these sales you are buying the entire corporation including the Accounts Receivables, Accounts Payables and any and all Liabilities.
An Asset Sale is typical when buying a smaller business. In an Asset Sale the buyers are purchasing the assets of the business including the name, fixtures, furnishings and equipment, inventory (if it applies), website, phone number, customer list, etc. The company name can pass on to the buyer by setting up a new entity and doing a DBA (Doing Business As).
The main purpose of doing an Asset Sale is to protect the buyer from any liabilities that could have happened prior to the Closing. Example would be that a party slipped and fell in the establishment 3 months ago and has now hired an attorney to sue for pain and suffering. If the buyer had done a Stock Sale, they would be the ones being sued even though they were not the owners at the time of the incident.
In an Asset Sale the buyer is responsible from the Closing Date forward for any liabilities that could occur. That is why business insurance is purchased.