The original words of the song altered with the fluctuations of Britain's power; 'Britannia, rule the waves' later became 'Britannia rules the waves' in Victorian times, because Britain did, indeed, rule the waves!
Who ruled the waves?
A Britain ruled the waves, in part, because no one else attempted to. The other candidates, France, America and Russia, all underwent internal upheaval or had other priorities for much of the 19th century that prevented them from making a serious challenge to British control of the world's oceans.
Why did Britain rule the seas?
The British Royal Navy held command of the sea for most of the period between the 18th to the early 20th centuries, allowing Britain and its allies to trade and to move troops and supplies easily in wartime, while its enemies could not.