Old English stemn, stefn "stem of a plant, trunk of a tree," also "either end-post of a ship," from Proto-Germanic *stamniz (cognates: Old Saxon stamm, Old Norse stafn "stem of a ship;" Danish stamme, Swedish stam "trunk of a tree;" Old High German stam, German Stamm), from suffixed form of PIE root *sta- "to stand" (see stet).
Meaning "support of a wineglass" is from 1835. Meaning "unchanging part of a word" is from 1830. Stems slang for "legs" is from 1860. The nautical sense is preserved in the phrase stem to stern "along the full length" (of a ship), attested from 1620s. Stem cell attested by 1885.