Caffeine, a well-known stimulant that impacts the nervous system, may contribute to the onset of migraines for some people.