"stick for striking fire," late 14c., macche, "wick of a candle or lamp," from Old French meiche "wick of a candle," from Vulgar Latin *micca/*miccia (source also of Catalan metxa, Spanish mecha, Italian miccia), probably ultimately from Latin myxa, from Greek myxa "lamp wick," originally "mucus," based on notion of wick dangling from the spout of a lamp like snot from a nostril, from PIE root *meug- "slimy, slippery" (see mucus). Modern spelling is from mid-15c. (English snot also had a secondary sense of "snuff of a candle, burnt part of a wick" from late 14c., surviving at least to late 19c. in northern dialects.)
Meaning "piece of cord or splinter of wood soaked in sulfur, used for lighting fires, lamps, candles, etc." is from 1530. First used 1831 for the modern type of wooden friction match, and competed with lucifer for much of 19c. as the name for this invention.