Cavalier is a word of many meanings.

A cavalier can be a mounted soldier or knight.
It can also be a courteous gentleman or a chivalrous man (especially one who escorts a woman of high social standing).
In a third meaning of the noun, written capitalized, a Cavalier was a supporter of Charles I, King of England, during the English Civil Wars (1642-51).

The adjective cavalier meant gallant before the 1640s. This was tied to the knight and chivalry meaning of the noun. Later cavalier came to mean disdainful, haughty, or offhand.

Cavalier in its adjective sense can also mean carefree, nonchalant, or jaunty. Example: "His cavalier behavior belied the pain he felt after being snubbed for the promotion."

The word cavalier is a French spelling of the word for knight taken ultimately from the Late Latin caballarius (horseman).