late 15c., probably an unexplained variant of Middle English maðek, from Old English maða "maggot, grub," from Proto-Germanic *mathon (cf. Old Norse maðkr, Old Saxon matho, Middle Dutch, Dutch made, Old High German mado, German Made, Gothic maþa "maggot"). Figurative use "whim, fancy, crotchet" is 1620s, from the notion of a maggot in the brain.