A shareholder agreement is a contract among the shareholders of a company, defining their rights, responsibilities, and protections. It may detail how to manage disagreements, how shares can be sold or transferred, and how the company will operate. A well-crafted shareholder agreement can help prevent disputes and ensure the smooth functioning of the business.