Barzal sort of replaces EP...without him in the deal, the Canucks would still need a second line centre otherwise as they are competing now. Trading EP for Dobson alone would make the Canucks much worse. A big part of this trade is because the op thought the Islanders may go in a different direction and maybe wouldn't want to commit huge dollars to Dobson who is having an up and down season (along with Barzal and Pettersson). Isles get a franchise centre and Canucks get a solid top pair Dman and a solid 1B/second line centre.
Cap wise, Barzal = $9.15; Dobson = $4M (for now); total = $13.15...Pettersson = $11.6M so the Canucks need to create $1.55M of space which I believe they would have by waiving the RD who is losing their spot to Dobson along with what they left in space.