Aerobic running is using Oxygen (in the air) to break down glycogen into usable energy forms. An anaerobic state occurs in the absence of enough oxygen for these processes to occur.
Whereas normal aerobic running uses Oxygen and produces Carbon Dioxide (which we breath out), anaerobic running has an additional byproduct - lactic acid. Lactic acid produces an uncomfortable sensation in the muscles where it is produced, and hangs around in the body - it is difficult to remove. As such it is especially important that a runner does not enter an anaerobic state too early in their race as it will hinder their performance.
Entering an anaerobic state is oftentimes not simply due to a lack of Oxygen but rather due to the bodies inability to transport the available Oxygen to the muscles where it is needed efficiently and quickly. This is why a well developed cardiovascular system will allow you to spend more time in an aerobic state, and is why we specifically train our cardiovascular systems.
Through training your body adapts in a number of ways to make the transport and usage of available Oxygen as efficient as possible. This includes capillary development, mitochondrial development (the factory that converts Oxygen into energy), and a general increase in the number of red blood cells. These adaptations aid in the transport and utilisation of Oxygen as well as the removal of lactic acid.
If you have ever donated blood you will have likely noticed that your next runs feel a bit more laboured than before. This is because donating blood removes it from your system. Your body will begin to replace that lost blood but the various adaptations will have been lost.
There is a common misconception that shorter distance races (like the mile) are predominantly anaerobic distances and that long distances (like the marathon) are predominantly aerobic. Whilst it is certainly the case that longer distance races should be run at a slower pace (at which the body can maintain an aerobic state) it is not correct to suggest that shorter distances should be predominantly anaerobic.
Your pace over a mile will almost certainly be faster than that over the marathon but it should still be predominantly aerobic due to the shorter distance. The shorter distance does however mean that a small anaerobic period is more acceptable as the body will only be in that state for a short period of time prior to your recovery period.