I think I'm wired with the potential to eat more than I burn because the opposite is dangerous (long-term) and its hard to anticipate future burn when I eat.
There would need to be a lot of food 'abundance' for the negative effects of this to ever come to fruition to the point of influencing evolution, and fixing the brain malfunction.
You gain weight because you eat more calories that you burn. This is, again, mathematically correct, but it offers no explanation of the why
Why do you eat more than you burn ? you move too little ? you eat too much ? your brain malfunctions and it is unable to detect food intake ?