Historical note. The adjective "cavalier" is derived from the noun "cavalier."
The "caval-" part means horse, like "cavalry" (like Spanish "caballo" or French "cheval").
A cavalier is a fighter who rides a horse--a cavalryman, a knight, a mounted soldier. French, chevalier. Spanish, caballero.
During the English Civil War of the 1600s, the formal names of the two sides were the "Royalists" who supported the King, and the "Parliamentarians." But they were nicknamed the Cavaliers and Roundheads. (These are proper names, so they are capitalized).
The Cavaliers had a reputation for being arrogant (and/or dashing and elegant). So "cavalier" means dismissive, contemptuous, or arrogant, like the Cavaliers.
The British poet Robert Browning wrote a series of poems, "Cavalier Tunes," depicting the Cavaliers as masculine, manly, and dashing:
Boot, saddle, to horse, and away!
Rescue my castle before the hot day
Brightens to blue from its silvery grey,
CHORUS.---Boot, saddle, to horse, and away!