A stock purchase agreement provides the terms for the purchase and sale of shares between a company and its investors.