stud (n.1)
"nailhead, knob," late 13c., from Old English studu "pillar, prop, post," from Proto-Germanic *stud- (cognates: Old Norse stoð "staff, stick," properly "stay," Middle High German stud, Old English stow "place"), from PIE *stu-, variant of root *sta- "to stand" (see stet). Sense expanded by late 14c. to include ornamental devices fixed in and projecting from a surface. From the Old English meaning comes the specific sense "one of the small beams of a building which form a basis for the walls."
stud (n.2)
"horse used for breeding," Old English stod "herd of horses, place where horses are kept for breeding," from Proto-Germanic *stodo (cognates: Old Norse stoð, Middle Low German stod, Old High German stuot "herd of horses," German Stute "mare"), from PIE root *sta- "to stand," with derivatives meaning "place or thing that is standing" (cognates: Old Church Slavonic stado "herd," Lithuanian stodas "a drove of horses;" see stet). Sense of "male horse kept for breeding" is first recorded 1803; meaning "man who is highly active and proficient sexually" is attested from 1895; that of "any young man" is from 1929. Stud-poker (1864) is said to be from stud-horse poker, but that phrase is not found earlier than 1879.
stud (v.)
c.1500, "set with studs;" 1560s in studded with "as though sprinkled with nails with conspicuous heads;" from stud (n.1).