Labor disputes in the N.B.A. have a way of producing strange and unintended consequences: $30 million contracts for backup centers, trades of retired players and David Stern’s infamous beard, to name a few.

Thirteen years ago, the N.B.A. locked out its players and started a protracted battle over the league’s financial future. Owners wanted cost certainty and a hard salary cap. The players union resisted, as players unions always do.

After 204 days and hundreds of millions of dollars lost, the parties adopted a new labor deal, just in time to stage a 50-game season. When the standoff was over, the owners had won new controls on salaries. The union had secured a huge share of league revenue. And Stern, the N.B.A. commissioner, had acquired a face full of gray scruff that stood as a frightful symbol of the 1998 lockout.

“As a basketball fan and particularly a fan of the N.B.A., I am elated,” an unkempt-looking Stern said in January 1999 after the new deal was adopted.

Asked last Thursday if the lockout had been worth it to get the deal he got, Stern gave an unequivocal, “Yes.”

Eight hours later, Stern shut down the league again, claiming that the system he fought for was now broken. The owners, as before, are seeking a hard cap and an assurance of profitability. The players union, as before, is fighting to protect past gains.

It is 1998 all over again, except that the owners — claiming losses of more than $300 million a year — are more determined than ever to impose absolute cost controls.

How did a system that was once trumpeted as a huge victory for the owners become so burdensome?

“I think it was clear — even though that deal worked well for the times — that the holes in the cap were ultimately going to destroy its effectiveness,” Russ Granik, the former deputy commissioner, said in a phone interview.

In fact, Granik said, the league “has been on a quest” since 1984, when the first soft-cap system was adopted, “to tighten the cap as much as possible.” It has done so in nearly every collective bargaining agreement.

The 1999 deal contained three new cost controls: a luxury tax for high-spending teams, an escrow tax that capped the players’ share of revenue and, for the first time, a cap on individual player salaries — initially $9 million to $14 million. (Michael Jordan, for perspective, earned $33 million in his final season with the Bulls.)

These were revolutionary measures, celebrated by owners and decried loudly by player agents, who were furious with the union for accepting the deal.

“In ’99, the N.B.A. achieved total victory,” Arn Tellem, one of the league’s most powerful agents, said in a phone interview. “There’s not much more they could have achieved.”

Initially, the owners seemed to get the desired results. In the first season that the tax system was in effect, 2001-2, teams did not spend enough in the aggregate to put it into effect. The next year, 16 teams paid $174 million in taxes (led by Portland, with an astronomical $52 million bill). The total number of taxpaying teams dipped to 12 in 2003-4, and the tax disappeared again in 2004-5, when aggregate spending again fell below the trigger point.

As recently as 2006-7, only five teams paid the tax — a dollar-for-dollar surcharge on payrolls that exceeded $65.4 million that season. But a year later, eight teams crossed the threshold, paying a combined $92.5 million in taxes. In 2009-10, with the threshold set at $69.9 million, 11 franchises went over, paying a combined $111 million in taxes.

Only seven teams paid the tax this past season, spending a combined $72 million over the limit. Three teams were egregiously over: the Lakers ($20 million), the Orlando Magic ($20 million) and the Dallas Mavericks ($19 million), who won the championship.

In fact, the last four champions were luxury taxpayers — a troubling trend for a league in which many small-market teams struggle to remain competitive. (The league is also working on a new revenue-sharing plan.)

“We had predicted the tax would be more of a drag on salaries than it’s turned out to be,” said Adam Silver, the current deputy commissioner. “It became business as usual to pay the tax, and therefore it created a league of haves and have-nots, where you have the Lakers at $110 million and Sacramento at $45 million.”

Silver was referring to the Lakers’ total investment in salaries — a $90 million payroll, and $20 million in taxes — an outlay that is nearly double the current salary cap ($58 million). Seventeen teams were over the cap but below the tax threshold ($70 million). Only six teams were under the cap this season.

The soft-cap system is defined by numerous “exceptions,” which allow teams to exceed the cap to re-sign their own players (Bird rights) and to add free agents (midlevel exception, veterans’ exception). Teams that can afford to routinely use the exceptions do so, creating a market that sometimes skews player values.

Teams have made countless mistakes using the midlevel exception, which was designed to save the middle class. Perhaps the most infamous example was the Knicks’ 2005 signing of Jerome James, a plodding backup center, to a full midlevel deal, worth $30 million over five years.

The Bird exception has also produced some comical transactions. In 2008, two retired players — Aaron McKie and Keith Van Horn — were signed to contracts just so they could be packaged in multiplayer trades. Neither one ever played.

Agents and players argue that it is not their responsibility to save the owners from themselves. Yet the collective bargaining agreement is largely a set of rules designed to do just that. When those rules fail, the owners push to tighten them, the better to avoid future mistakes.

A hard cap might serve as a bulwark against future Jerome James contracts. With the star players making most of the money, there might not be much left to overpay journeymen.

As far as the players are concerned, the current system does enough — capping the earnings of star players and rookies, slowing payroll growth and punishing the free spenders.

Far from being too generous to players, Tellem said the 1999 deal (which was renewed with minor changes in 2005) had been financially punitive.

“The vast majority of players have been hurt by this agreement,” he said. “This agreement has served to benefit the bottom third of the union.”

The league has generally prospered since the 1999 deal, with revenue more than doubling, to $4.3 billion. Franchise values have skyrocketed. But on a year-to-year basis, the league says it is losing money.

Everyone has complaints about the 1999 agreement. But it is instructive that the players generally want to retain the system, while the owners want a major overhaul.

So they are back at the bargaining table, pushing for shorter contracts, smaller raises, less guaranteed money and no cap-busting exceptions. They seem to be digging in for another long fight. It could be 1998 all over again, with one caveat: no lockout beard.