Actually it's my impression that most of the companions left by choice.
Quite often they chose to stay behind after an adventure with the Doctor. For example, Leela chooses to stay on Galifrey with Andred; Adric chooses to stay and try to divert the spaceship from crashing into prehistoric Earth; Romana chooses to stay in E-Space along with K9; Nyssa decides to stay on Terminus; Peri marries King Yrcanos (Brian Blessed!); Jo Grant decides to marry an environmentalist and go and work in the Amazon... and so on.
In fact just about the only companion I can think of that was forced to leave was Sarah Jane, who was (as she later complained about to the EighthTenth Doctor) dumped off when the Fourth Doctor is summoned back to Galifrey.