O, wouldn't it be lovely if you could lose weight by eating more?
The balance of your diet, and particularly the regularity of your meals (little and often is good, starvation is bad), but the basic formula is inescapable: if you eat more than you metabolise you gain weight. If you eat less, you lose it.
Some people are lucky: they can eat anything they like, and burn it up. Others, like me, constantly have to be careful, or see it go on and stay on. Very few (and if is very, very few) have a genuine medical condition that make it all but impossible to control body mass, but even then, the cruel truth is that they have to eat less than they do, or change their diet, to achieve weight control.
Taking plenty of exercise, and leading a heathly lifestyle are both good for their own sake, but they are secondary factors in weight control. You need to do a massive amount of extra physical exercise to burn off the calories in a huge plate of greasy fried food: and going to one of those "eat as much as you like" buffet style restaurants can be good, because you can eat just as much as you know is appropriate, and not try and finish the ridiculous plateful the waitress just brought you.
You are what you eat!