The biggest difference is that an SPA is the sale of all shares, and an APA is the sale of selected assets. Therefore, they are both different transactions and have different procedures.
In a stock sale, the seller (e.g., John Smith, as an individual) sells the actual ownership of his entity (Corporation, LLC, etc.) to the buyer. This would be similar to owning a share of Ford Motor Company and selling this share of stock to another individual.
A SPA is a legally binding contract that sets out the terms and conditions of a sale between a buyer and a seller. It is typically used in the context of buying and selling a business or a significant asset, such as shares in a company.