Quite a number of words that have existed in the English language (and in other languages, as well) were coined in imitatation of some sound.
One of these is swash, little used now, but apparently originally created as descriptive of the sound of a blow.
A buckler, back when knighthood was in flower, was a particular kind of small shield, chiefly used to catch the blows of an adversary.
So a swashbuckler was one who, when fencing, put on a show by making a great noise, striking his opponent’s buckler with his sword.
From this, the term was broadened to describe any swaggering show-off.