Why is fasting asked for before some blood tests?
Some blood measurements change substantially after eating and some barely move. Fasting is requested for the ones that do, so that a result reflects your baseline rather than your breakfast.
Glucose is the clearest example, which is why fasting glucose is a defined test rather than just a glucose test. Triglycerides in a lipid panel also respond noticeably to recent food and alcohol, which is why fasting is sometimes requested before cholesterol testing and sometimes not, depending on what is being asked.
The instruction you are given matters more than the general rule, because it depends on the exact tests ordered and how long beforehand. If you have eaten when you should not have, say so rather than proceeding quietly, because a result interpreted as fasting when it was not can be misleading.