The interesting part is that the NBA's cap is "soft". As was stated above, you can use certain exceptions to go over the cap. However, for every dollar you go over the salary cap using these exceptions, you have to pay (I think) another dollar to the league as a penalty. So even though it seems like everyone's on an equal playing field, teams in large markets like LA, NY or Brooklyn can afford to go far over the cap and pay the tax, while teams with cheaper owners/smaller markets usually try to stay at or slightly underneath, giving the larger markets a bit more flexibility.