For example: You are Team A. And you have a John Doe who makes $1.00 per year. And he signed a 5 year contract for $5.00. Then another team is Team B. They have two crappy players who make a combined $28.00 per year. And you trade John Doe to Team B for the two crappy players. Now does Team A pay the traded John Doe? Or do they pay the remainder of the two crappy players?
The contracts are swapped. Team B now only pays for that 1.00 player. However, with the salary cap, very rarely are trades more than 15% financially off from each other.
The exceptions being the following: 1) When both teams are substantially under the cap (not very likely as stated). or 2) When the receiving team (team A in the example) is enough under the salary cap to absorb the contract differences without going over the cap. Reason #2 is one reason so many BBS trades with the Clipps are proposed...they're always under the cap!