It’s the card game for intellectuals, mathematicians, and those who like a real chance at beating the house. For years it was obscure, then it was popular, and now it has faded. Blackjack is proof that it’s not really the product itself that matters—it’s what customers can do with it.

The game of blackjack dates to the middle of the 18th century. Like many other gambling pastimes (poker, for one), it originated in France, although Americans gave the game its present form.

Also known as twenty-one, the object of the game is simple: beat the dealer’s total without going over 21, or busting. The player gets two cards, and the dealer gets two, only one of which is visible to the table. The player then decides whether to hit (get another card), stand, split (if dealt two identical cards, for example a pair of eights), or double down (double the wager and receive one, and only one, new card). Under traditional rules, a natural blackjack (the player draws an ace and a ten-value card) pays three to two, meaning a $100 bet returns $150. All other bets pay even money; if the player busts before the dealer, he loses, and if the player and dealer tie, it is a push (neither side wins).

For about two hundred years, blackjack was the casino equivalent of a benchwarmer. Into the 1950s, the most popular casino game in Las Vegas was craps, a rollicking, social game that was seen at its most colorful in Guys and Dolls. When the dice were hot, craps was a party, and when they weren’t, everyone suffered together. Blackjack, by contrast, is a game that pits each player individually against the dealer and often each other. A novice player who deviates from basic strategy and hits when standing is advised might be castigated for “taking the dealer’s ten.” Crapping out, by contrast, can only be blamed on the whimsy of luck, which, as Sky Masterson knew, isn’t always a lady.

So how did isolated, intellectual blackjack push aside brawny, crowd-pleasing craps? Math, which might be fearsome when it’s on a test but positively friendly when it can make you money. In 1956, a quartet of U.S. Army mathematicians—who have gone down in the annals of blackjack as the Baldwin group—published an article in the Journal of the American Statistical Association that described for the first time a mathematically correct set of rules for the game. Known as basic strategy, this approach dictates to the player how to proceed with any hand.

Basic strategy, perfectly executed, cut the house edge to almost zero, which turned a few heads. Then, in 1962, UCLA math Ph.D. Ed Thorp published Beat the Dealer, a best-selling paperback that explained to the general public how, by counting cards (keeping track of how many high-value cards remained in play), players could actually have a statistical advantage over the house.

This was the casino equivalent of splitting the atom: an awesome, unpredictable power unleashed. Smart, disciplined players could be guaranteed—at least statistically—to beat the casino. Blackjack quickly became the most popular game in the casino, though casino managers’ initial panic mellowed to wariness as they realized that not all players are as smart of disciplined as they’d like to believe.

Blackjack’s popularity from the 1960s onwards is instructive: nothing about the game itself changed. There were no new layouts, no attempts to make the game more social, no outreach to customers. If anything, antsy casino managers often made the game less welcoming. And yet blackjack grew, in spite of the casinos, because the customers had figured out a way to, at least sometimes, win.

For decades, blackjack remained the king of the tables. The game even had a revival after 21, a 2008 film based on the real-life exploits of the MIT counting team, introduced counting to a new generation. But nothing lasts forever, and on the Las Vegas Strip, at least, blackjack has of late played second fiddle to baccarat, which is preferred by Asian ultra-high rollers.

Competition from baccarat, slot machines, and other games isn’t the only thing that’s hurting blackjack, though. Many casino managers, who have always been uneasy at the game’s potential upside for players, have whittled off a little of the player’s edge here and there in an effort to make the game more profitable.

The first step was changing the rules on how the dealer acted when dealt a soft 17 (an ace, which can count as an 11 or one, and a six). Traditionally, the dealer stood on soft 17. Modifying the rules to mandate the dealer take another card on soft 17 added about 0.2 percent to the house edge. It doesn’t seem like much, but it adds up, particularly in a game whose edge was close to zero. Multi-deck shoes, restricting pair-splitting options, and automatic shufflers were other seemingly-small tweaks of the rules in the house’s favor that were designed to contribute to the casino’s bottom line, and in the short term they might have, but long-term they drove off some customers.

The biggest offender, though, was 6:5 blackjack. This variation, which is regrettably common in Las Vegas casinos, cuts the payout on blackjacks from 3:2 to 6:5; that $150 win we celebrated in the third paragraph is now only $120. It went over as well with serious blackjack players as spore drive did with Star Trek purists, and rightly so: 6:5 blackjack bumps the house edge on a perfectly-played basic strategy game to nearly two percent.

Proponents of 6:5 and the other edge-padding rule changes argue that the vast majority of customers don’t know the difference. Walking a casino floor and seeing 6:5 tables packed with smiling players, they might be right. But the numbers tell a different story.

Since 2000, the number of blackjack tables in the state of Nevada has fallen by over 31 percent. Yes, but the amount casinos win from blackjack is still the same, some might argue, so things aren’t that bad. Factoring in inflation, though, the amount Nevada casinos have won at blackjack has fallen by 46 percent.

It might be said that the expansion of casino gambling to other states is more to blame than anything inherent in blackjack itself, and that might be somewhat right. But baccarat and sports betting in Nevada have made real gains over the past two decades. Those games, it must be said, have for the most part resisted the belt-tightening of blackjack. And only resort fees and paid Strip parking have attracted the level of fury that 6:5 blackjack has.

The lesson of blackjack goes beyond the gaming tables. Anyone who sells anything to other people, be it hospitality, food, or even words, should pay attention. It may be frustrating, but we can’t control what customers do and don’t like. It would be great for our business if they always chose the highest margin items, letting us make an easy living. But customers know that’s not a good deal for them, so they choose differently. And that’s not the worst thing. On paper, card-counting was a game-breaker, but in reality, most players lost because counting is easier said than done. But as that theoretical possibility of winning has decreased—even if most actual players don’t play well enough to notice the difference—the allure of the game has faded.

Casinos have found that, even shaving just a little bit off here and there, patrons realize when they’re no longer getting the best of it, and they vote with their wallets.

Get the best of Forbes to your inbox with the latest insights from experts across the globe.

Follow me on LinkedIn. Check out my my website