Groom \groom\ , noun;
1. A bridegroom
2. A man or boy in charge of horses or the stable
3. Archaic: A manservant
1. To tend carefully as to person and dress; make neat or tidy
2. To clean, brush, or otherwise tend an animal
3. To prepare for a position, election, etc.
I've been reading Pillars of the Earth by Ken Follett and the word groom is used quite a bit to mean "man or boy in charge of horses or the stable." The book is set in 12th century England, so I assumed it to be a precursor to the modern usages of the word. Turns out, I was only half right.
The core word here is the noun groom, which dates to the 1200's from groome ("male child, boy"). It has no known cognates in other Germanic languages, so its etymology is uncertain. It may derive from Old English *groma, which is realted to growan ("grown") or it could be a borrowing from Old French grommet ("servant"). The meaning "male servant who attends to horses" dates to the 1660's and eventually transformed into the verb usages of this word in the mid-1800's. The figurative sense of "to prepare a candidate" is first attested in 1887 and was originally an Americanism.
Now for the other half. Groom, meaning the husband-to-be at a wedding is a shortening of bridegroom, which dates to the 1600's. Bridegroom comes from Old English brydguma ("suitor"), which is a combination of bryd + guma ("bride" + "man"). -Guma turned into -groom in the 1700's because of a folk etymology that connected the word to groom as outlined above. But, since a folk etymology is a false etymology, the connection is obviously tenuous.