The word 'sock' is derived from the old English term 'socc', which simply meant light slipper - and that word is derived from both the Latin term 'soccus' and Ancient Greek word 'sykchos', which both described low heeled shoes worn by actors.
Aside from being fashionable, socks help to regulate the body's perspiration; a person's feet produce a disproportionally high amount of sweat, which socks absorb so it can be more easily evaporated. In colder climates like ours, of course, heavy wool socks also help to insulate against heat loss.
The oldest pair of socks we physically have were excavated in Egypt; created by a process called naalbinding, this footwear dates to 300 - 500 BC amd appears to have been specially designed to complement sandals. Documents from Greece and Rome suggest that most socks in antiquity were created from either furs or matted animal hair; the Greeks called their socks 'piloi', while the Romans called theirs 'udones'. The Catholic church had their own unique socks created in the 5th century - 'puttees' - meant to symbolize purity.
By the time the middle ages rolled around, socks were part of an aesthetic symbolizing wealth and nobility, knit with intricate designs and lengthened to match with shorter breeches. In the late 1500s, sewing machines were invented in Europe - producing socks six times faster than hand knitters, and making them accessible to most of the public rather than a fashion item exclusive to the ultra rich.
Nylon, invented in 1938, completely transformed the clothing industry but especially impacted sock production. Today, most socks are produced using some sort of nylon blend.
A simple concept that is fit for a king and universally practical.