In determining who to trade, I think the most important thing the Leafs need to be asking themselves in both cases, is this player going to be here in October 2025? and if the answer to that is probably not, then you would push to move him.
For Tavares, yes, if he's out, you might as well try to accelerate that process; and use his cap hit a year earlier. That being said, I'm not so sure the Leafs view him as "out" in 25-26. I don't think they want to tack the "C" onto Auston Matthews as it's a distraction; and I think they believe Tavares will sign a sweetheart deal after being overpaid for most of his previous one. He's not the player he used to be, but he did pot 29 goals and 65 points, and is only 1 year removed from the point per game pace he's been on for basically his entire tenure with the Leafs.
From a short term perspective, I think they also look at the roster and realize, they don't have a #2 centre in the system ot replace him, nor are the UFA options great.
For Marner, his next contract negotiation isn't likely to be all that complicated. He's going to ask for $12.5m, and he's not going to take a penny less than Nylander's $11.5m (and may not even be willing to sign for that).
For a team that just spent 6 years languishing in the problems associated with having Matthews at $11.6m, Tavares at $11m, Marner at $10.9m, and Nylander at $7m; it's really difficult to say "I'm going to commit to Matthews at $13.25, Marner at $12m, and Nylander at $11.5m"; and not have self doubts about your sanity.
Sure, you can justify it as the cap being higher and growing (something that was supposed to happen when they signed the first round of contracts). On the flip side, it arguably makes less sense to have those 3 big hits (34/16/88) versus the original big 3 (34/91/16); simply because there's only 1 centre there.