Depending on what it's packaged in it may decide to store it and use it later (fat) or burn it. Furthermore, if your body is not getting the proper nutrients in the food you eat, protein for example, it will go after your muscles to get that. And so while you may be at a caloric deficit you won't be losing fat, you'll be losing muscle, which will in turn slow down your metabolism, making it so that you burn less calories on average and making it harder to lose weight in the future. Furthermore, what you eat influences the hormones that your body creates that determine whether or not your body chooses to burn or store fat. So if you eat a lot of foods that cause an insulin spike, you will lose weight less efficiently than someone who eats healthier foods that cause a normal insulin reaction, regardless of whether or not you're at a caloric deficit.