Nash got a 1st, a B prospect, Spooner, and a 7th with the Rangers taking on about 1M in dead cap via Beleskey.
Even if Karlsson is unremarkable for the entire season, which would be surprising, San Jose could get back a big chunk of the perceived Sept 2018 value of what they gave up for Karlsson.
By that, I mean if Dylan Demelo moves to C and is the next Gretzky, obviously they aren't getting back that kind of value, but nobody would have perceived that to be likely at the time of the trade.
A GM will take a chance on Karlsson based on his previous play in the playoffs and the hope that playing for a big payday will further motivate him. That's the beauty of the trade for San Jose, short of a season ending injury they easily get back a 1st, 2nd, player, and a prospect (if not more) for Karl at the deadline. That's a huge chunk of what they gave up.