Shareholders have an ownership interest in the company whose stock they own, and companies can't generally take away that ownership. However, there are a few situations in which shareholders must sell their stock even if they would prefer to hold onto their shares. The two most common are when a company gets acquired and when it has an agreement among shareholders calling for forced sales.

The takeover situation
When one company chooses to buy out another in a stock-based acquisition, the acquirer generally seeks to gain 100% ownership of the target corporation. Corporate law typically allows the acquirer to gain full ownership of the target even if shareholders who in total own a minority interest in the target company oppose the acquisition. The required vote favoring the merger can vary depending on what's stated in the company's articles of incorporation. Some companies require a simple majority, while others require supermajorities of anywhere from two-thirds to 90% of outstanding shares.

When this occurs, the acquiring company pays objecting minority shareholders the same amount of cash, shares of the acquiring company, or a combination of both that those who favor the acquisition receive. As long as that compensation is deemed to be fair value for the stock, the recourse for the objecting minority shareholders is limited.

Shareholders' agreements
Shareholders' agreements are relatively rare in companies whose stock is publicly traded, but they are prevalent in privately owned companies. That's because minority shareholders can create substantial problems in a small-company context, especially when they seek to sell or transfer their shares to third-party buyers.

To protect against potentially problematic situations, a shareholders' agreement can specify certain conditions under which one shareholder must sell shares to fellow shareholders or back to the company. For instance, some companies give the company the right of first refusal to buy back shares that pass to an heir after the death of a shareholder. Other agreements can force a sale based on other conditions, such as a merger offer or a change of control among corporate leadership.

The agreement will often set the amount of compensation that the selling shareholders will receive for their shares. In some cases, the payment the selling shareholders will get won't necessarily reflect the current fair value of the shares, but they will reflect a formula that all shareholders will have agreed upon when they initially signed the agreement.

Forced sales among shareholders aren't all that common, and in most cases, shareholders are happy to sell shares in situations involving acquisitions. Nevertheless, knowing that a forced sale is possible is important in planning your long-term investing strategy. Choosing the right broker is important, too: Click here to visit our broker center and compare features and fees. 

This article is part of The Motley Fool's Knowledge Center, which was created based on the collected wisdom of a fantastic community of investors. We'd love to hear your questions, thoughts, and opinions on the Knowledge Center in general or this page in particular. Your input will help us help the world invest, better! Email us at [email protected]. Thanks -- and Fool on!