In English, “underwear” is a general term for all kinds of clothing worn next to the skin, so underpants, bras, vests
These are also known as pants.
The term ‘knickers’ originates from America
It is a shortening of knickerbockers and first found in 1859, used as a shortening of knickerbockers by Cruickshank for his Illustration of the History of New York. When his illustrated work was published in London in 1859 it saw, almost over night, the term begin to be used to replace the French pantalettes (from which we get pants)

Knickerbockers began as a term referring to a style of trousers originally worn by the Dutch settlers but that became increasingly popular in Golf and are also known as plus twos and plus fours.
Knickerbockers did not just refer to the baggy short trousers worn, but to a series of characteristics associated with old Dutch settlers becoming a local byword for an imagined old Dutch-descended New York aristocracy with old-fashioned ways, long-stemmed pipes, and wearing knee breaches long after the fashion had turned to long trousers (slacks).

As women began to wear underwear in the 19th C (it had in general not been worn before then) they started with baggy linen pants down to above the knees that resembled knickerbockers.

From 1859, to distinguish the female undergarment from the male trousers, the term knickerbockers was reserved to the plus fours and twos (except in Britain) while knickers (first used in the USA) was reserved for “a short loose-fitting undergarment for women”. By 1882 this use was widespread.

Male knickerbockers were superseded post WWI by shorts [although still worn in rural communities and when shooting on the larger estates in Scotland, England and Ireland (my father had tweed plus fours for example)].

Today knickers can mean any of female panties, male short-legged underwear or a pejorative way of saying Rubbish! or Get Lost!
The name Knickerbocker comes from an invented personality: Diedrich Knckerbocker in the 1809 History of New York by Irvine. He based the name on his close friend, Herman Knickerbocker, whose own grandfather had invented the name when he landed in New Amsterdam in 1682.

Mutual synonyms
underwear drawers shorts pants breeches knee breeches knickerbockers briefs romper pantaloons rompers underpants panties britches denims
https://stravaganzastravaganza.blogspot.com/2016/10/a-brief-history-of-knickers.html
