We get fat when we take in more energy than we expend (a positive energy balance, in the scientific terminology), and we get lean when we expend more than we take in (a negative energy balance). Food is energy, and we measure that energy in the form of calories. So, if we take in more calories than we expend, we get fatter. If we take in fewer calories, we get leaner.