The luxury tax is one of the main components of the soft salary cap which exists in the NBA. In fact, the luxury tax one of the main components that makes the salary cap "soft."
In the Collective Bargaining Agreement between the players and the owners, a soft salary cap is set for every team. A luxury tax line is then set based on the salary cap figure. If a team's salaries go over the tax line for the season, they must pay luxury tax. In the current CBA, that luxury tax is dependent on how much over the limit the team is and how many times the team has been over the cap. If the team is over the cap for the first time during the CBA, the tax ranges from $1.50 per dollar over the cap to as much as $3.25 per dollar over the cap. The 2012-13 salary cap is approximately $70M, so if a team spends $75M on salaries, they have to pay tax on the extra $5M. Repeat offenders pay one dollar more than the standard tax rate. The tax money paid for a given season gets placed into a pool and is split evenly among teams that did not pay the luxury tax that season.