Bayern is a very wealthy club with a very sound financial policy. Basically, they can keep any players they want. They also don't let players go easily. Lewandowsky did leave last season, but that must also have had to do with his age. They handled that reasonably well with Mane.
bayern didn't want to let Lewandowsky leave, Lewandowsky wanted to leave because from what I could understand the team wanted to hire haland to replace Lewandowsky and he didn't like that attitude from bayern and started campaigning to leave bayern as soon as possible, it wasn't a good attitude how bayern treated Lewandowsky. as for money, bayern has money and has been able to manage the players well, they have something very good, which is not constantly selling players and being harmed by such a sale
Lewandowski had a contract with Bayern for a year and Bayern wanted to extend the contract for another year (quite logical given his age), but this was not enough for Lewandowski and he began to rant. As a result, Bayern sold him and I dont think that they were in the red, but Lewandowski lost the Champions League playoffs for the first time in many years. I think he acted like an idiot.