It was the company that was supposed to revolutionize local commerce. Small businesses that had never really advertised were signing up en masse. Consumers lined up with paper vouchers in hand to get meals for half off. It spawned thousands of competitors looking to cash in on the daily deals craze. Investors salivated at the prospect of a company that some bankers thought would be worth more than $30 billion.

Fast forward a few years and many merchants have related their horror stories with running Groupons. The consumers who haven’t unsubscribed from Groupon’s mailing lists just ignore the e-mails. The vast majority of competitors have died off; the largest one, D.C.-based LivingSocial is hanging on for dear life. Groupon stock is trading for less than half of the price you bought it for if you were “lucky” enough to be an insider and get in on the IPO price of $20.

What happened? Economics happened.

The value proposition of Groupon was literally too good to be true. The general structure of Groupons was simple. Consumers received products and services for half off and then Groupon took half of what remained. A restaurant that sold a $50 Groupon for $25, received $12.50. That meant they were selling meals for less than the food cost them. (A typical restaurant spends 30 percent of revenue on food.) Those long lines meant big losses — unless people came back and ate at full price. But with another Groupon being offered somewhere else tomorrow and the next day and the next day, why would they?

The first dot-com bubble was driven in part by companies selling dollars for 50 cents. The daily deals bubble was driven by Groupon convincing small businesses to sell their dollars for 50 cents and charging them a quarter for the privilege.

As a society, we’ve gotten used to Internet magic. We store our pictures, call friends, have video conferences and read the news — all for free. Much of this is driven by venture capitalists and other investors who are willing to fund our habits while companies figure out a business model. A lot of it is sustainable because of the massive scale technology can provide and declining costs of things such as storage and bandwidth. Spread development costs across tens or hundreds of millions of users and it can work. The incremental cost of serving a new user is tiny. That’s how technology companies work.

So we weren’t suspicious when Groupon promised us half off things that we wanted to try.

But Groupon never was — and still isn’t — a technology company. It’s a sales and marketing company that relies on other businesses being willing to sell their products and services.

When those companies started doing the math, they realized they weren’t getting what they bargained for. Many customers didn’t spend more than the value of the Groupon. Instead of seeing a lot of new faces, neighborhood restaurants saw their regulars coming back with Groupons, turning a full-priced sale into one that was 75 percent off.

A lot of those companies dropped out of the Groupon merchant pool; it just didn’t make sense. Some companies modified their offers. Instead of being able to use a Groupon just like cash, you could use it only for selected items or at certain times.

What we’ve seen over the last few years is businesses becoming smarter about when and how to discount. That means more fine print, which is a turn off for consumers.

I was at Utah Olympic Park in Park City, Utah, earlier this year. They had just run a Groupon. There are three things that people go there for: a guided tour of the site of the Olympic Games, to ride the bobsled and to ride the skeleton. Sorry, no discounts for any of those. The Groupon was only valid for the ropes course.

They’re a smart Groupon merchant: they didn’t discount the things that their typical visitor would pay full price for.

As the merchants have become smarter, we’re reaching an equilibrium where only deals that make financial sense for everyone get offered. That’s the way it should be.

The author is a consultant focused on the intersection of local, social, mobile and payments. You can follow him on Twitter.