People who lie awake at night are rarely worried about having nothing to eat tomorrow. What keeps them up is how many more years of mortgage are left, whether their kid will get into that school, who in the old classmates' group chat just got promoted.
What we're short of has changed. We used to be short of food. Now we're short of being a little better off than other people.
In the same essay where he predicted his grandchildren's lives, Keynes had already pulled these two apart. People have two kinds of needs, he said. One is to be fed and warm: once you're full, you're full, and how well the neighbors eat doesn't make you any hungrier. The other is to be better off than others, and you only feel at ease once you're ahead of the people around you. The first kind, Keynes said, has a limit. The second may never be satisfied, and the better off everyone gets, the higher it climbs.
The two kinds of shortage get filled in different ways. If you're short of food, you grow a bit more or earn a bit more, and the gap is filled. If you're short of being better off than others, whether you can fill it isn't up to you. It depends on who you're measuring against. The same salary is a good life in one village and not enough among another crowd. With this kind of shortage, the ruler you measure with decides everything.
The ruler used to be the people around you. Whoever you compared yourself with was basically a few dozen households in the same village or on the same street. When a family built a new house, everyone could see it. When a family was in debt, everyone knew that too. You were comparing yourself with people whose lives were much like yours and whose circumstances you knew inside out. The ruler was short, and the gaps it could measure were limited.
Television stretched the ruler. In the 1990s, the American economist Juliet Schor studied how people spend money and found they no longer kept their eyes only on the neighbors. They had started comparing themselves with people far richer than they were, and with people on TV shows. The houses the families on those shows lived in and the cars they drove were mostly upper-middle-class or above.
Television aired a few episodes a day. The people on your phone stream in nonstop, and they've been picked twice. The first pick is made by the people posting: everyone shows the dinner table, nobody shows the bill. The second pick is made by the app: out of hundreds of millions of people, the ones ranked in front of you, again and again, are always the few who look like they're living best. Even among the people you follow yourself, the ones you see most are the ones the algorithm pushed to the top.
The ruler you measure yourself against is now marked off by the small slice of people living best in the whole world, and it measures their shiniest side. This ruler moves up with you, too. Move into a bigger apartment and you see bigger ones. Get your kid into a good school and you see someone else's kid learning a third foreign language.
Think about it: the last time you felt you didn't measure up, who were you looking at? Do you know that person in real life?
To be better off than others, plenty of people would rather earn less. Two researchers at Harvard asked a group of students and staff to choose between two worlds where prices were the same. In the first world, you earn twice what everyone else does. In the second, you earn twice as much as you would in the first, but everyone else earns more than you. Close to half chose the first world.
Put real comparisons in front of people and the result is even clearer. In 2008, a California newspaper put the salaries of all public employees online, where anyone could look them up. A group of economists picked some University of California employees at random and emailed them about the site. Close to half of those who got the email went and looked, and what most of them looked up was their coworkers' pay.
A few days later, the economists asked everyone how satisfied they were with their jobs. Among those paid less than their coworkers, the share who were both dissatisfied and planning to look for a new job in the next year was forty percent higher than among people who hadn't gotten the email. Those paid more than their coworkers were no more satisfied for it.

Comparison doesn't cut the same way at both ends. Those who come out behind feel worse, and those who come out ahead get no extra happiness. So the more people can see, the more the hurt outweighs the gladness, added up.
When everyone compares, nobody ends up with more. The British economist Fred Hirsch put it this way: in a crowd watching something, when the people in front stand on tiptoe, the people behind have to as well. "If everyone stands on tiptoe, no one sees better." They're all just more tired. Apartments in good school districts work like this. In China, a family will drain six wallets, the couple's and both sets of parents', to buy into one. The good school still has the same number of places. All that went up is the price of getting in the door.
Someone at the side of this tiptoe contest is collecting money. The longer you watch other people's good lives, the more attention the app harvests. You open it to see how other people are doing. It makes money as long as you keep watching. A ruler that puts your mind at rest once you've measured won't keep anyone around. A ruler that always leaves you a little short brings you back every day to measure again.
In its first two years, Facebook opened up one college at a time. Three economists compared students at 775 colleges before and after it arrived. Wherever Facebook went, students became more prone to depression and anxiety, by about a fifth as much as the harm from losing a job.
The students hit hardest were those already inclined to feel they didn't measure up: for example, those living off campus who didn't fit into the party scene, and those from poorer families. The classmates they saw online seemed to have far livelier lives than the classmates they knew in person. After Facebook arrived, students were more likely to believe their classmates were drinking more, when in fact they weren't.
Facebook back then had no recommendation algorithm. It just let people at the same school see each other. Change the ruler to your own schoolmates, and it already measured out that much depression. Today's ruler is picked out of hundreds of millions of people by an algorithm and handed to you.
