I've worked a company that was profitable, operated well, growing ... but were sold and the CEO said (I'll get the words not quite right):
"I fought for keeping independent and not selling, that's how I've kept that company and I wanted it to stay that way. But the offer was increased into the range where I didn't feel like I could survive a legal challenge (if it came to that) as far as my requirement to do what is best for the shareholders."
In the case of that CEO, I believed him (i'm not usually inclined to do so). I could be wrong, of course he made a lot of money, but this guy really did seem like he really did like building companies so to speak and that was more a motivation than anything else. But in his case I think he was right, he couldn't seriously argue that he could likely provide a return to investors even for a decade or more than they could get taking the offer right then and there.
It is a problem I always worry about, good businesses are there to return value to the stockholders, it makes sense. But in the face of gobs of cash they must fold.... and so often poorly managed after that and some things are lost. It's a black hole in the free market.