The Cavs season ended in disappointment, and frontcourt issues were a part of that. Mobley and Allen are an elite defensive pair, but the offensive fit is very questionable. The Cavs really lacked spacing in the postseason, so here they move one of their two towers for some better fits. THJ can slot in at the 3 and bring elite floor spacing (ended the year shooting ~45% on almost 8 threes per game). Wood can help fill the minutes in the front court, also being a very good shooter, especially for a big. They also get the 10th pick in the draft where they could draft an immediate rotation player.
The Mavs need size and defense inside, so Allen is a perfect fit for that.He is young as well, so he can grow with Luka. He can help shore up some huge needs on the Mavs roster. Cedi can factor in on the wing as well and bring some size there.