But for the sake of argument, say the salaries didn't match.
We'll call the waived player "Bonner" because it's shorter than saying "the waived player with a $3-4M salary".
Say the Spurs want to pick up a SF, but will go over the cap if they do. Assume the salary of the SF is $1M. They could "dump" Bonner's salary in this manner to dip below the cap and then pick up the $1M SF (possibly throwing in a non-guaranteed contract if done soon).
So we could be talking about 3 teams. The Spurs, the team with the $1M SF, and the team picking up Bonner. (Assuming the teaming has cap room for Bonner)
Theoretically speaking of course...