There are all sorts of scenarios relating to managers leaving.
E.g Sacked, resign or mutual consent. Yes there is a lot of money involved but an agreement is usually reached-very few get to a tribunal.
This link explains some of the above.
https://sqaf.club/how-much-football-managers-paid-when-sacked/