In the context of the NBA and MLB If a team sends cash along with players and/or draft picks in a trade, that cash is still counted as salary spending by the team sending the cash. This is not much of a problem in the NBA and MLB as it is in the NFL, which has a “hard cap” that can’t be exceeded for any reason at any time. In some cases, when a trade is made, a player’s old team is still “on the hook” for paying his salary, either fully or partially, and that is charged to the old team.
There are also trades, usually made after the trade deadline, where the new team negotiates a “buyout” of the player’s contract. But, in that case, the buyout money, while less than paying the player for the rest of his contract term, the new team takes the salary cap hit.