This is a very basic example.... hopefully I get it right
Salary Cap:
Each team has a salary cap (i can't remember the figure at the moment). For this example lets say $50 million. As a player is signed to a contract that contract's vaule is held agains the cap (so we have player A with a $10 million contract leaving $40 million in available space).
Once the team has all it's players their contracts make up how much the team is spending. That amount - say they have $55 million in contracts, is minused against the cap (so 50 - 55 = -5) and this team is over the cap by 5 million.
Trading:
When you trade players you can only trade with up to a 10% difference in contracts if the team receiving the player is over the cap.
So if I am trading player A ($10 million) for player B ($9.5 million) to the Clippers (who are over the cap) then this trade will work because the contracts are less than 10% different. However, if player B's contact was worth only $6 million then it wouldn't go through as the Clippers don't have enough space.
If I was trading with a team which had space available under the cap, say the Bobcats, I could trade players with contracts that had greater than 10% difference as long as the team had room for the difference between contracts.
So for example the Bobcats have $7 million in cap space. I am trading player A ($10 million) for player B ($5 million). This trade will work because the bobcats have more space ($7 million) than the difference in contracts ($5 million).
Also, for both of the above the teams have to also accept the players being traded
as well as the contract.
I hope there aren't too many errors in the above. Please feel free to correct me!
Cheers