The two adrenal glands sit above the kidneys. When you are frightened, stressed or excited, they release adrenalin into the blood. This prepares the body for fight or flight, so that you can either stand and deal with the danger or run away from it.
Adrenalin has several effects. The heart rate increases, so the heart pumps more blood each minute. Blood pressure rises. More blood flows to the muscles, which delivers extra oxygen and glucose for respiration, so the muscles can release more energy. Adrenalin also raises blood sugar levels, by stimulating the liver to change glycogen into glucose, which is released into the blood.
All of these changes get oxygen and glucose to the muscles faster, which is what you need to fight or run.