Editor’s Note: Nir Eyal is the author of Hooked: A Guide to Building Habit Forming Products and blogs at NirAndFar.com.

Wednesday was my birthday. It should have been a great day. My wife and daughter had prepared a delicious breakfast, I had lunch with close friends, and I finished up some writing and client work. At the end of the day I headed to San Francisco to enjoy a swanky scotch tasting at a friend’s house.

Then I heard the news. WhatsApp had been purchased by Facebook for $19 billion. When I read about the deal I blurted out the words, “Holy Crap!” so loudly that a stranger nearby gave me a disapproving look.

I was having a fantastic day just minutes before but suddenly I felt crummy, like something unjust had happened. The malaise lingered as my mind began to rationalize the news. Was the deal justified? Why had Facebook paid so much? What did the deal mean for the future of the tech industry?

However, the question that most disturbed me was why hadn’t I built WhatsApp? The simplicity of the app made it look easy. Perhaps, I thought, I should get back to starting companies instead of writing books about them.

Then I remembered one of my favorite monkey studies. A bit of primate psychology helped me regain my sanity.

Frans de Waal, a primatologist at Emory University, wanted to know if capuchin monkeys felt jealousy in the same way humans do. His study began by training two monkeys with identical cucumber slices. Whenever they completed a task, in this case retrieving a rock and handing it to a researcher, they each received a slice of cucumber. When both monkeys were offered the same reward, they completed the task as prescribed.

Then things got interesting — as they often do when researchers start messing with monkeys. De Waal knew his capuchin monkeys adored grapes, almost as much as we entrepreneurs lust for “liquidity events.” This time the researcher gives one monkey a grape while giving the other a slice of cucumber.

After giving his rock to the researcher, the stiffed monkey glances over at his lucky comrade, who by this time is wolfing down the juicy grape. He then looks down into his little monkey paws where only a measly pale green cucumber slice awaits him.

Seconds earlier, this monkey was perfectly content with his reward but now it’s clear he isn’t happy. The cucumber pieces had suited him fine as long as the other monkey got the same. However, now that the other monkey got something much better, monkey hell breaks loose. The monkey stages an emotionally charged protest. He shrieks, throws his cucumber at the researcher, bares his teeth, thrashes in his cage, and slaps the table.

Clearly, we aren’t the only primates who value the ideal of equal pay for equal work. As a two-time entrepreneur who never got close to a billion dollar buy-out, I empathize with that raging monkey. My team and I had worked hard for our reward and did just fine, and yet, we’d never had a WhatsApp-sized payday. It’s hard not to ask, “Where’s my grape?”

And that’s the source of the problem. I loved being an entrepreneur and I love what I do today, just as the capuchin monkey enjoyed his cucumber before the other monkey got something better. It is only when we become cognizant that others have more that we feel unsatisfied with what we have.

As another example, think sex. Researchers have known for some time that, “frequency of sexual activity is shown to be positively associated with happiness,” — no big surprise there. However, what is less well understood is how our happiness is affected by the amount of sex we think other people are having. According to a study at the University of Colorado at Boulder, believing that other people are having more sex than you makes you less happy, even if you are having plenty of it.

It appears we are hardwired for jealousy. Perhaps there is an evolutionary benefit to the dissatisfaction that comes from wanting what others have. However, unlike lower primates, we humans have the ability to consciously self-reflect. Perhaps we can’t help feeling like the monkey in De Waal’s experiment when we see others getting more. However, our tendency to compare ourselves to others does not have to make us unhappy. We have a choice.

When I arrived at the scotch tasting the night of my birthday, my friend Andrew Warner proposed a toast. “On Nir’s birthday, I want to share something that has stuck with me from the first time I met him.” Andrew held up his glass of whiskey, “We were sitting around a dinner table a few years ago when someone brought up the topic of how to relate to wildly successful people.” I vaguely recalled the conversation and I wasn’t sure what Andrew would say next. “That’s when Nir said that once you find the thing you love doing, nothing else matters. You just can’t ask for anything more than that.” We clinked glasses and I was thankful for the timely reminder of our conversation.

Image by Flickr user Carsten Schertzer under a CC BY 2.0 license

Note: For more, check out Hooked: A Guide to Building Habit-Forming Products. Nir will be speaking at the upcoming Habit Summit at Stanford. TechCrunch readers get $50 off when using this link.