Here's what happens: Once a person's body weight goes up by more than a few pounds, a part of our brain called the hypothalamus registers this new equilibrium and kicks in to "sustain" the newly added body weight. In other words, the brain tells our body: "Now that you added some new body mass, you must maintain this body mass within normal parameters. Which includes adequate nourishment." So concretely, you'll feel the drive to eat more, just so you sustain the new body mass you have gained. This is a tricky vicious circle which, if left unchecked, can result in significant weight gain over a short period of time.
The moral of the story is the following: Once a person gains weight (in excess of 2-5 pounds), loosing it will be difficult and will involve overcoming hunger. The more rapid and significant the change in weight, the harder it will be to reverse.
So what's the solution? Well, just this: Any weight gain in excess of a few pounds should be promptly corrected as soon as it occurs. This means increasing your physical activity level by a moderate amount and reducing your calorie intake mildly to moderately until your weight is back to baseline. If you are unable to exercise, you must be much more careful and proactive about any increase in your weight, since your only recourse is dieting (which may be difficult due to the hunger mechanism described above). Monitor your weight regularly (say 2-3 times a week), and reduce your calorie intake by a small to moderate amount as soon as you notice any weight increase.