I'm not a professional PT, but from what I've read into it, it's how you allocate your macronutrients.
Your muscle and size comes from having adequate protein (not excessive - apparently 0.8g per lb of bodyweight is the norm), and then balance the rest out with fats and carbs. Excessive carbs can lead to excess fat, contrary to popular belief. You need enough carbs for the exercise and whatever you do during the day; also you would want to have adequate glycogen stored in your muscles.
The idea though is to eat more of the food that will burn up more calories than you will gain. So high fibre food tend to help e.g. vegetables. You will also need to be wary of your intake of micronutrients e.g. vitamins, minerals, etc. So regulate your intake of fruit, vegetables, etc., most of which don't amount to many calories anyway.
Then it also depends on how you want your abs to look. Do you want them to buff out like you see on some bodybuilders, or do you want them to be noticeable but not pop out? For the former, you want to do intense core workouts and high protein intake, possibly with medium to high carb intake depening on the workout. Whereas the latter require minimal core concentrated work and a heavier focus on low calories.
I'd recommend following a professionally laid out workout and diet plan for the look you want, or speak to a PT. If you want, you can become a PT yourself.