A firm is sold when its owners believe they will get the best price. The selling itself is more of a symptom than a cause.
Businesses (and any other kind of asset) are sold for all kinds of reasons, and trying to time the market to maximize the price is only one of them. Probably not even the most common one.
It’s not necessarily the sale. Some private equity companies move from “Let’s invest like we’re shooting for the moon” to “Let’s invest like we want to improve margins and flip this on 3-5 years”
It’s not inherently wrong but it is a different model, and sometimes companies suffer as a result.