A salary cap sets a ceiling on what a team may spend on players. The way rosters are actually built comes from the exceptions and penalties layered on top of it.
A soft cap is a set of exceptions
A hard cap forbids exceeding the limit at all. A soft cap allows it under defined circumstances, most importantly to re-sign a team's own players.
That single exception shapes everything. Retaining a player you already have is easier than acquiring an equivalent one, so continuity is subsidised by the rules.
The practical effect is that rosters are built through the draft and then held together, rather than assembled from the open market each year.
Luxury tax penalties escalate deliberately
Spending above a second threshold triggers financial penalties that increase with the amount exceeded and with repeated years above the line.
The escalation is designed to be prohibitive rather than merely expensive, so that sustained overspending becomes untenable even for wealthy ownership.
Restrictions beyond money often accompany it, limiting how a heavily spending team may acquire players at all, which is a harder constraint than the payment itself.
Maximum contracts distort player value
Individual contracts are capped as a share of team payroll, which means the very best players are structurally underpaid relative to what they contribute.
That creates surplus value in a star contract, and the surplus is what allows a team to field a competitive supporting cast within the same ceiling.
It also means the difference between a very good player and a great one is not reflected in cost, so acquiring the greater one is the highest-leverage move available.
Cheap contracts do the balancing
Rookie-scale contracts and minimum deals provide production far below market rate, and a contending roster typically depends on several of them.
Development staff therefore carry competitive weight, since converting a low-cost player into a rotation contributor is one of the few ways to add quality without payroll.
The window closes when those players become eligible for market-rate extensions, which is why contending rosters have a natural lifespan.
Trades become arithmetic before they become basketball
Teams above the cap must match salary in a trade within defined tolerances, so a deal has to balance financially before it can be evaluated on merit.
This is why contracts of modest players appear in large trades. They are there to make the numbers work rather than because either side wants them.
Draft picks function as the flexible currency in these deals, since they carry future value without occupying present payroll.

