The undershirt and pants widening downward are a typical image of a sailor. This cut of clothes is called "cloche" (from the French "cloche", bell). And, although, flared pants have become ubiquitous attribute of youth fashion of the 60's and 70's, they were invented by the Navy for a reason. Wide-bottomed pants look original on land, but at sea they are also very practical.

And they began to be worn at the time of wooden sailing ships. The fact is that such a cover allows the sailor to comfortably perform their daily duties. Pants do not constrain the movement, they are comfortable to climb the ropes and masts. They roll up quickly and easily, so you won't get them wet when you're cleaning the deck or jumping into the water from the dinghy.
In addition, a sailor's job always involves the risk of falling into the water. Therefore, clothes should be quickly removed if necessary, so as not to interfere with the swim. A navy jacket had a wide neckline and could be quickly removed. The boots usually did not have laces, but special inserts that allowed them to be removed in seconds. So, too, in addition to the wide shape of the trousers, had a buckle called a "latsbant," easily unbuttoned and to get rid of the pants in the water, it was enough to jerk the legs a few times.
The original invention of the pants is attributed to the Dutch, but they were first made a mandatory part of the sailor's uniform in the United States in 1810. Over the next decades, sailors in most naval countries switched to a uniform with flared pants. Nowadays, sailors do not need to climb up the masts, life jackets are provided in case they fall into the water, and overalls are worn for cleaning. That's why today only a few countries have left flared trousers as part of the modern uniform.