A slight rephrasing of what has been said already . . .

The original "blue bonnet" was made with a sleeve along what is now the "headband" portion. The hat was "ballparked" in size and the ribbon was used as an "adjuster" for the hat size, so it wouldn't blow off in the highland winds. This ribbon was tied in the back (how else would it work as a sizer without tying it somehow).
While on the topic, the old ribbon was not quite like the ribbed polyester ribbon today. It was most likely a woven wool or linen ribbon.

When the hats became more precisely made to size, the ribbons were reduced to redundant decoration on the back. Whether they should be left loose or tied is largely a matter of opinion. Some like the "flowing"/"blowing" look of the loose ribbons. Others insist that they should be tied, like the integrated ribbons of auld.
There are also "rules" cited as to what either loose or tied are supposed to mean. However, they really could/would NOT be worn loose before they became redundant, so the rules could not be that old. Personally, some of mine have functional ribbons, some have tied sewn on ribbons (making bows), and some loose ones too. I am not sure which I like most.