The trade was made by the Toronto Maple Leafs specifically to get out of the Nikita Zaitsev and Connor Brown contracts.
Getting Cody Ceci was a complete bonus.
The Leafs get a former first round pick with size and puck moving ability who has a ton of top-line NHL experience for literally no cost.
It is the ultimate risk/reward scenario: low possibility of a high reward for zero risk.
The stats suggest that he is over played, over paid, and not top-four material, but the Leafs signed him anyways because he is the exact kind of player that other NHL GMs always overpay for, making the risk non-existent.