In genealogy, a cadet is a younger son, as opposed to the firstborn heir.
The word has been recorded in English since 1634, originally for a young son, identical to the French, which is itself derived from the Gascon Occitan (spoken in Gascony in southwest France) capdet "captain, chief", in turn from the Late Latin, the diminutive of Latin "head" (hence also chief).
Younger sons from Gascon families were apparently commonly sent to the French court to serve as officers; as a rule, non-heirs from the European nobility sought careers in the military or the clergy.
As an adjective, "cadet" is used to signify a junior branch of a family. Thus, the Orléans line was a cadet branch of the Bourbon family, which itself was a cadet branch of the House of Capet.
For the status as such, the noun cadency exists, as in the heraldic term mark of cadency, for a feature which distinguishes a cadet son's coat of arms from the father's which is passed on unaltered only to the (usually firstborn) heir.
Military has been the traditional career choice of the nobility throughout the centuries, and it has been customary that the firstborn son inherited the title, lands and possessions, while the younger sons of a noble family went to the military, often to be trained as officers. Hence the meaning "cadet branch" for a junior branch of a family and the term "cadet" for an officer trainee.