An incorporated business can be sold either by way of assets, or by way of shares.
An asset sales means that the Business is selling all of its operating assets to a buyer; generally, this includes the business name and good will as well as the operating assets. The business discharges its liabilities, then it ether closes, or does something else. The buyer ends-up with a brand new business either with the name of the previous business, or with a new name.
In a share sale, the shareholders of the Corporation, together as the Seller, sell all the shares of the Corporation to a buyer. The buyer then inherits the Corporation, with all its assets and liabilities (known or unknown). An indemnity agreement is used to protect the buyer for liabilities due to past events or actions taken by the Seller up to the day of the sale. The buyer takes the place of all the previous shareholders and continues operating the business as his own.
Below is a link to three articles that discuss the subject in some details. Buyers should read them and be aware of the implications that may affect the business operations going forward. The Buyer should also discuss the subject with his legal and financial advisors, with regards to all the different aspects of the business.
https://www.bdc.ca/en/articles-tools/start-buy-business/buy-business/owner-liability