Do we really have free will when it comes to eating? It’s a vexing question that is at the heart of why so many people find it so difficult to stick to a diet.

To get answers, neuroscientist Harvey J. Grill of the University of Pennsylvania turned to rats and asked what would happen if he removed all of their brains except their brainstems. The brainstem controls basic functions like heart rate and breathing. But the animals could not smell, could not see, could not remember.

Would they know when they had consumed enough calories?

To find out, Grill dripped liquid food into their mouths.

“When they reached a stopping point, they allowed the food to drain out of their mouths,” he said.

Those studies, initiated decades ago, were a starting point for a body of research that has continually surprised scientists and driven home that how full animals feel has nothing to do with consciousness. The work has gained more relevance as scientists puzzle out how exactly the new drugs that cause weight loss, commonly called GLP-1s and including Ozempic, affect the brain’s eating-control systems.

The emerging story does not explain why some people get obese and others do not. Instead, it offers clues about what makes us start eating, and when we stop.

While most of the studies were in rodents, it defies belief to think that humans are somehow different, said Jeffrey Friedman, an obesity researcher at Rockefeller University in New York. Humans, he said, are subject to billions of years of evolution leading to elaborate neural pathways that control when to eat and when to stop eating.

As they have probed how eating is controlled, researchers learned that the brain is steadily getting signals that hint at how calorically dense a food is. There’s a certain amount of calories the body needs, and these signals make sure the body gets them.

The process begins before a lab animal takes a single bite. Just the sight of food spurs neurons to anticipate whether a lot of calories will be packed into that food. The neurons respond more strongly to a food like peanut butter — loaded with calories — than to a low-calorie one like mouse chow.

The next control point occurs when the animal tastes the food: Neurons calculate the caloric density again from signals sent from the mouth to the brainstem.

Finally, when the food makes its way to the gut, a new set of signals to the brain lets the neurons again ascertain the caloric content.

And it is actually the calorie content that the gut assesses, as Zachary Knight, a neuroscientist at the University of California San Francisco, learned.

He saw this when he directly infused three types of food into the stomachs of mice. One infusion was of fatty food, another of carbohydrates and the third of protein. Each infusion had the same number of calories.

In each case, the message to the brain was the same: The neurons were signaling the amount of energy, in the form of calories, and not the source of the calories.

When the brain determines enough calories were consumed, neurons send a signal to stop eating.

Knight said these discoveries surprised him. He’d always thought that the signal to stop eating would be “a communication between the gut and the brain,” he said. There would be a sensation of having a full stomach and a deliberate decision to stop eating.

Using that reasoning, some dieters try to drink a big glass of water before a meal, or fill up on low-calorie foods, like celery.

But those tricks have not worked for most people because they don’t account for how the brain controls eating. In fact, Knight found that mice do not even send satiety signals to the brain when all they are getting is water.

It is true that people can decide to eat even when they are sated, or can decide not to eat when they are trying to lose weight. And, Grill said, in an intact brain — not just a brainstem — other areas of the brain also exert control.

But, Friedman said, in the end the brain’s controls typically override a person’s conscious decisions about whether they feel a need to eat. He said, by analogy, you can hold your breath — but only for so long. And you can suppress a cough — but only up to a point.

Scott Sternson, a neuroscientist with the University of California in San Diego and Howard Hughes Medical Institute, agreed.

“There is a very large proportion of appetite control that is automatic,” said Sternson, a co-founder of a startup company, Penguin Bio, that is developing obesity treatments. People can decide to eat or not at a given moment. But, he added, maintaining that sort of control uses a lot of mental resources.

“Eventually, attention goes to other things and the automatic process will wind up dominating,” he said.Researchers continue to be amazed by what they are finding — layers of controls in the brain that ensure eating is rigorously regulated. And hints of new ways to develop drugs to control eating.

One line of evidence was discovered by Amber Alhadeff, a neuroscientist at the Monell Chemical Senses Center and the University of Pennsylvania. She recently found two separate groups of neurons in the brainstem that respond to the GLP-1 obesity drugs.