Tryptophan is an amino acid (a kind of protein) your brain uses to make serotonin, and in experiments, more tryptophan in the blood causes more serotonin in the brain. What does it matter? Well, if you don't have enough serotonin, it can make you depressed and irritable. This is especially important for women ("Women have much less serotonin in their brains than men," says this article from MIT).
Almost all good sources of protein have many different amino acids, including tryptophan, so it shouldn't be a problem to get enough tryptophan, right? Unfortunately, the other amino acids compete with tryptophan to get into the brain.
But if you eat some carbohydrates with your protein, the insulin your body releases in response to carbohydrates takes the competing proteins out of your bloodstream, which allows more tryptophan to get into your brain.
If you eat meals containing nothing but protein, your serotonin level will be low (too much competition so not much tryptophan can get into your brain). If you eat nothing but carbs, you won't have any tryptophan (it's a protein), so your serotonin level will be low. If you drink a sugary beverage, you have put calories into your body and missed an opportunity to make serotonin. If you eat a fruit snack and nothing else, you missed another opportunity. But if you always mix protein and carbs together in every meal, you will get the maximum tryptophan into your brain, so you'll have enough serotonin, and that will help you feel good.
A nice side-effect is that a higher serotonin level suppresses your appetite. A low serotonin level makes people crave carbohydrates. Isn't that interesting? This means if you eat nothing but protein, you will crave carbs. But if you eat only carbs you will still crave carbs because you're actually craving the tryptophan you need to raise your serotonin. It's as if your body assumes the protein will be there, so it only craves carbs. But carbs won't do it. Mix some good quality protein in there (and good quality carbs too while you're at it) and you have the best chance of being slim and happy.
Adam Khan is the author of Self-Help Stuff That Works and Cultivating Fire: How to Keep Your Motivation White Hot.