Wow, pretty big news.
Trading Niskanen was predictable (and here I agree with others that this is another good sign of a GM that recognizes obvious roster/cap issues), but the return is surprising, at least at first glance.
I would've expected/preferred for the Caps to trade Niskanen for futures/young players, and then fill any voids on D with some cheaper vets in free agency.
So my first reaction is that Gudas must've been a guy they really liked (rather than "filler"), at least significantly more than any realistic free agency target that would also fit their cap/roster planning for the next couple of years.
What I remember from watching Gudas is assuming that he's just a goon, and then waiting for the forwards to dance around him, but it somehow never really seemed to happen -- his positioning remained solid and the effort/grit was pretty elite.
I dunno if this can be called a great move for the Caps, I think that'll depend on both Gudas's quality and whether he gets re-signed, but it definitely seems like a strange move for the Flyers. Seems pretty easy to find decent vets for leadership purposes in free agency -- especially if you're not in a cap crunch.
Re: Niskanen, I think he has a good chance to bounce back with a full summer of rest, but this season was pretty baffling, maybe he can't consistently handle top assignments any more.