A rights plan is triggered when a party exceeds a stated stake, commonly 10% to 20%. Every other holder can then buy shares at a deep discount, so the bidder's stake is diluted to irrelevance. In practice pills are almost never triggered; their purpose is to force the bidder to negotiate with the board.
Pills are also used against activist-investor stake-building, and boards adopt them defensively after a sharp price fall.
Example: a bidder buys 11% of a company with a 10% pill. Remaining holders can buy shares at half price. If they do, the share count roughly doubles and the bidder's stake falls from 11% to about 5.5% while its cost per share of influence doubles.
Related: hostile-takeover, activist-investor, proxy-fight