Why weight gain occurs again once we discontinue the slimming centres?

Why weight gain occurs again once we discontinue the slimming centers?
It has been generally seen that once people discontinue the slimming centers the weight gain occurs. The possible reason for this is that they are not properly educated about the calorie count. That is why when they start consuming normal food at home they gain weight. The weight loss that had occurred was basically due to the machines and various weight loss techniques.