Suit has a suite (and, yes, that word is related) of diverse meanings in law, fashion, romance, and card playing that are actually cut from the same cloth. The word ultimately derives, via Anglo-French suite, from Vulgar Latin sequitus, meaning "to follow." And exactly how did sequitus become suite in French, you might ask? The medieval Latin equivalent of suit (in some senses) was secta, meaning "sect" or "set," and the French made it their own, initially forming seuta or suita.
Early Uses of 'Suit'
Before suit came to refer to a legal action, it had various senses in Middle English referring to acts of following or pursuing, literally and figuratively. Early uses of suit refer to the required attendance by a tenant at his lord's court as well as to a company of followers in general.
His train and suit of followers was disposed agreeably to shun both envy and contempt; not like that of the Vicount St. Albans, or the Bishop of Lincoln, whom he succeeded, ambitious, and vain; his Port was state, theirs ostentation.
— Harmon L’Estrange, The reign of King Charles, 1655
Suit was also used about the same time to refer to the pursuit of game—later to the pursuit of a criminal on the run. Here's a matter-of-fact quote from 1666:
You shall also enquire whether Hue and Cry, and fresh Suit be duly made and pursued, after Robbers and Felons….
— Ph. Ag., The power & practice of court-leets, 1666
In the 16th century, the word came to designate a lover's persistent effort to win one's heart's desire as a suitor and, understandably, sometimes being a suitor involved some following.
Also seducers, sectuaries, &c. They all play as the fals harted man, which beeing put in trust to speake to a mayden for another, doe wooe and make suite for them selues, to tourne the liking of the mayden to their owne persons.
— Bartimaeus Andrewes, Certaine verie worthie, godly and profitable sermons, 1583
Legal Uses of 'Suit'
Senses of the word referring to the pursuit of justice were developed in the 14th century, when a tenant had to appeal to a superior for justice. The exact evolution of the legal sense is unclear, but it may have been influenced by the obligation of a tenant to be in suit (in attendance) at the court of a lord. Nowadays, legal suit refers to a complainant's attempt to redress a wrong or to enforce or protect a right or claim.
'Suit' and Clothing and Cards
The "clothing" sense of suit is also connected to the feudal court. Those in suit at the court of a lord often matched in attire. That led to the word being applied to boy's matching outer garments in the 15th century. Over time, that sense was adapted to other articles of matching clothing. Today, we have an array of suits, including the bathing suit, the bodysuit, the business suit, the catsuit, the jumpsuit, the leisure suit, the lounge suit, the pantsuit, the sailor suit, the shell suit, the snowsuit, the space suit, the sweat suit, the swimsuit, the three-piece suit, the trouser suit, the two-piece suit, the union suit, the wet suit, and the zoot suit.
From the "clothing" sense, suit began being used for sets of other matching objects, including the suits of spades, clubs, hearts, and diamonds in a deck of cards—and even hair.
From a thin, uneven suit of hair, with a crust of dandruff, she began to have a heavy, handsome suit of hair and no dandruff.
— Sara H. Henton, Christian Observer (Louisville, KY), 30 Oct. 1895