When you diet your baseline energy expenditure decreases, this sends the body into a state of hibernation leading to decreased energy expenditure. This leads to an increase in hunger and a decrease in satiety in turn leading to an increase in rewards based eating. This elicits a stress response triggering the body to store excess energy in the form of fat. Hormonally this leads to an increase in ghrelin (Ghrelin is produced by the stomach. Among its numerous functions, ghrelin increases appetite and stimulates the release of growth hormone) and a decrease in the satiety hormones namely GLP-1(Glucagon-like peptide 1 is a hormone produced in the gut and released in response to food.
It causes reduced appetite and the release of insulin) PYY (Pancreatic Peptide YY, a short peptide released by cells in the ileum and colon in response to feeding. In the blood, gut, and other elements of periphery, PYY acts to reduce appetite), CCK (cholecystokinin is a peptide hormone of the gastrointestinal system responsible for stimulating the digestion of fat and protein. Cholecystokinin, previously called pancreozymin, is synthesized and secreted by enteroendocrine cells in the duodenum, the first segment of the small intestine, and causes the release of digestive enzymes and bile from the pancreas and gallbladder, respectively. It also acts as a hunger suppressant) and Amylin (Amylin plays a role in glycemic regulation by slowing gastric emptying and promoting satiety, thereby preventing post-prandial spikes in blood glucose levels).
After a gastric bypass procedure, the inverse happens. Baseline energy expenditure increases by activation of brown fat that leads to increase in basal metabolic rate and burning of white fat. Due to the hormonally active bypassed stomach secreting hormones a feeling of satiety remains with a decrease in appetite. Ghrelin levels are reduced and an inverse increase in GLP-1, PYY CCK and amylin is found due to the food bypassing the first part of the small bowel and entering further down in the small bowel. Because the body now feels that it has enough to eat a general feeling of well-being is achieved and a stress response is not elicited, the body does not feel the need to store excess energy and a new metabolic set point can be achieved with a decrease in the storage of energy stored as fat.