The bacterial makeup of the intestines may help determine whether people gain weight or lose it, according to two new studies, one in humans and one in mice.

The research also suggests that a popular weight-loss operation, gastric bypass, which shrinks the stomach and rearranges the intestines, seems to work in part by shifting the balance of bacteria in the digestive tract. People who have the surgery generally lose 65 percent to 75 percent of their excess weight, but scientists have not fully understood why. Now, the researchers are saying that bacterial changes may account for 20 percent of the weight loss.

The findings mean that eventually, treatments that adjust the microbe levels, or “microbiota,” in the gut may be developed to help people lose weight without surgery, said Dr. Lee M. Kaplan, director of the obesity, metabolism and nutrition institute at the Massachusetts General Hospital, and an author of a study published Wednesday in Science Translational Medicine.

Not everyone who hopes to lose weight wants or needs surgery to do it, he said. About 80 million people in the United States are obese, but only 200,000 a year have bariatric operations.