early 13c., "building or enclosure where horses or cows are kept, building for domestic animals," from Old French stable, estable "a stable, stall" (Modern French étable), also applied to cowsheds and pigsties, from Latin stabulum "a stall, fold, aviary, beehive, lowly cottage, brothel, etc.," literally "a standing place," from PIE *ste-dhlo-, suffixed form of root *sta- "to stand, make or be firm."
Meaning "collection of horses belonging to one stable" is attested from 1570s; transferred sense of "group of fighters under same management" is from 1897; that of "group of prostitutes working for the same employer" is from 1937.
For what the grete Stiede
Is stole, thanne he taketh hiede,
And makth the stable dore fast.
[John Gower, "Confessio Amantis," 1390]