The logic behind it isn't really that complicated.
When the productive employees are baseball players, in order to keep them, you have to sign them to exorbitant guaranteed contracts that are based on past performance. You run the risk that they will soon become non-productive assets due to aging, injury or underperformance. And you'll still have to pay them.
So you trade them for prospects and try to rebuild that way.
None of which means I like the idea of losing guys like Bogey, JD, Eovaldi or least of all Devers.