A shareholder agreement is a legal contract between the shareholders of a company. It outlines the rights, responsibilities, and obligations of each shareholder, and highlights the rules governing the company's operations.