Under the broad heading of What causes hangovers? which is addressed in the link, along with some other alcohol-related information.
Congeners are toxic chemicals that are formed during fermentation, some liquors have more of them than others. These congeners are widely responsible for headaches.
Word to the wise: if you can’t pronounce “congener” anymore, stop drinking.
(h/t to YT and John)
(remember: Beer is good)
This is why they have those (annoying) track pads where you tap to click.