Why does gastric bypass work?

I keep hearing that the amount of food a person eats doesn't affect their weight and that it's genetic or health conditions. If that's the case how could gastric bypass even work? I even hear that eating less causes weight gain. So wouldn't people get really big after the procedure?
Why does gastric bypass work?
Post Opinion