You eat X calories, you use Y calories. If X > Y most of the difference is stored (as fat), if Y > X your body burn the energy stored (fat, at some point, but it depends).
It's simple math and it's scientifically proven. 2000 kcal are 2000kcal, it doesn't matter if they come from a single burger or 10kg of lettuce.
It's not what you eat, it is how much you eat.