Apple has built one of the most valuable companies in the world in part by telling customers not to buy its products and not to shop in its stores.

That was the insight I gleaned after stopping in to an Apple store recently. I was looking for a computer to replace the nine-year-old MacBook Pro on which I am writing this column. I was also considering getting a new phone and passing my three-year-old iPhone SE along to a family member.

I left without a new computer or a new phone, but with a valuable lesson—one that you wouldn't necessarily learn if you spent your time listening to the presidential candidates bashing technology companies. One of the best ways to succeed long-term in capitalism is by treating customers well rather than ripping them off.

I was eyeing one of the desktop computers with an integrated Apple screen, Apple keyboard, and Apple mouse that would have cost more than $1,000 altogether. But the employee at the Apple store advised me I'd be better off just getting a cheaper "Mac mini" and buying the mouse, monitor, and keyboard somewhere else. On the phone question, he said I should go to a Verizon store—it had better deals.

Maybe I was dealing with a rogue employee, but I doubt it. These retail employees and encounters are closely monitored and supervised. Maybe he was pushing me through a route that was more profitable for Apple, in which case, good for Apple for putting its shareholders first by prioritizing profits rather than gross sales.

What I think was happening, though, is that Apple, like many successful retailers, has figured out that it isn't just in the business of selling customers products. It's in the business of helping customers solve problems. Giving a customer good advice may mean that in the short term the company may generate less gross sales. But in the long term, that advice generates good will and loyalty and trust. Those intangibles are difficult to quantify, but they are worth a lot. One reason people are willing to pay more for Apple phones or computers than for competing products is the knowledge that you can show up in a store and deal with an employee who can see things from the customer's point of view.

Capitalism, in other words, isn't all casinos, gun manufacturers, and alcohol and tobacco companies. People often associate business with vice—greed to make money in a zero-sum framework at the customer's expense. And sure, there are some immoral capitalists, just like there are immoral socialists and immoral nonprofit executives. But at its best, capitalism reinforces virtue. The business owner's profit motive isn't inalterably opposed to the customer's interests; sometimes, it's well aligned with them.

As business advice, putting the customer first can be a cliché, the sort of thing you see on a needlepoint pillow or wall poster in the office of a small business. Apple is a big enough company with enough employees, products, and policies that plenty of customers, including me, sometimes experience exasperation with it as much as we experience a pleasant surprise.

But such surprises do happen, and not just at Apple stores. I've got an auto mechanic I like who sometimes, when I bring in the car needing repair for a minor matter, just does it for me free of charge. He's not doing it for me out of sheer kindness, I think. He's doing it because it makes me feel better about the times I go in there and drop $1,000. It's part of the relationship.

Business, like much of the rest of life, is a lot about human relationships. Apple has a great website and probably has the capability to answer customer questions over an app. But sometimes when you have questions you just want to go into a store and get advice face-to-face from a live person. Sometimes the person does help. It's in the company's best interest and the customer's.