The use of ‘scrambled egg’ on RN Commander’s SD Caps dates back to the 16th, 17th and 18th centuries when the RN had the concept of ‘rated’ and ‘unrated’ ships . ‘Rated’ ships were the larger or more important vessels, whilst ‘unrated’ ships were smaller or support vessels:
The ‘rated’ ships were commanded by an officer with the rank of Captain. The smaller unrated ships were commanded by Lieutenants who were given the temporary rank of Commander when placed in command of such ships, however they were addressed as ‘captain’ by their crew and we’re afforded the appropriate compliments. The ‘scrambled egg’ was introduced as uniforms developed as recognition of their command of the ship. Commanders that were successful in the command of non rated ships moved on to rated ships and were promoted to Captain.
The tradition of Commanders wearing ‘scrambled egg’ has stuck regardless of whether or not they command a ship today.