Its not the dehydration that gives you the hangover but it does contribute. It is in fact a product of your body's processing of the ethanol by an enzyme called alcohol dehydrogenase which works in the liver. Its product is an acetaldehyde which causes inflammation in blood vessels hence the thumping headache. Its toxicity in the digestive system causes nausea and vomiting.