Some weight loss surgeries prevent the stomach from stretching to full size.
Normally, it can hold about 6 cups of food. After some operations, it can only hold a cup or so. You feel full faster, so you eat less and lose weight.
Some surgeries also bypass part of the intestine, so you absorb fewer calories and lose weight.