Exactly. This is why WAR in baseball has proven to be effective in analyzing players.
It's not "we lose Palmieri we are losing 25-30 goals per season, who can replace that?" It's "we are losing 25-30 goals per season but could player A or B, given the same kind of icetime and responsibility, put up similar numbers to 25-30 goals". You might be surprised at the results.
Palmieri puts up 30goals/82 games during an NHL season and makes 4.65 mil per season
Player B puts up 20goals/82 games during an NHL season and makes 1.5 mil per season
Which is the better player for your team?
For the Devils, for just next season? Palmieri, because the marginal cost is almost meaningless, given how far away from the salary cap the Devils are - they can't possibly cram enough improvement into other positions with the dollars they are saving.
We've all been through more than a decade of losing players and saying 'Oh, it's fine, their replacement is cheaper'. And yes, that is true, and obviously when you lose a player who is UFA age, he is almost always on the downslope of his career. And I'm not saying the Devils should absolutely keep Palmieri - again, if they get a 1st round pick in return, he should be out the door. But if the returns are going to be on the order of a 2nd round pick, and he's amenable to staying, it's something they should consider doing.