There could be more to it. There's a hypothesis that microbiome changes could be a contributing factor[0].
Restricting food intake is similar in that it reduces stomach capacity[1], though almost certainly not as drastically as surgery. Lots of people have already mentioned fasting in this thread; I'll add an anecdote that for a few days after a fast, I get full much more quickly.
[0] https://biodesign.asu.edu/news/dramatic-shift-gut-microbes-a...
[1] https://www.ncbi.nlm.nih.gov/pubmed/8561056?itool=EntrezSyst...