Caffeine works mainly by blocking adenosine receptors in the brain. Adenosine builds up during waking hours and signals tiredness, so blocking it leaves the brain more alert, which can make simple reactions faster and more consistent, especially when a person is tired.
The benefit is usually modest and depends on dose, habit, and how sleepy someone already is. Heavy or frequent use can build tolerance, and too much caffeine can increase jitteriness, which may hurt precision on complex tasks.