For much of the 19th and into the 20th Centuries, the Royal Navy was kind of two-tiered. The top tier was their battle fleet, which they tried to maintain at a level that could take on the world's #2 and #3 navies at the same time. Introducing HMS Dreadnought kind of set everybody back close to something like the starting line, though USS South Carolina only came into the fleet after Dreadnought because of slower construction.
The second tier of the RN was a relatively inexpensive, somewhat lightly armed, fast cruiser fleet, which was deployed around the world so as to protect British shipping and colonies. This had the unavoidable effect of suppressing piracy and such.
WW1, WW2, the nascent ascendancy of aircraft carriers, the shrinkage of the British Empire, and the ascendancy of government social welfare programs obsoleted much of the RN's fleet and diverted the will and $$ from modernizing the RN without at the same time shrinking it (e.g. the RN's last, post-WW2 battleship was converted to razor blades in 1960, while USN Iowa class BBs were brought out of mothballs, updated some, and served during the Reagan and Bush Administrations (and maybe into Clinton's?). The massive build-up of the USN also encouraged this RN build-down.
While the focus in the West was the big threat, the USSR, this RN build-down effectively passed the piracy and rogue suppression task to the USN. The build down of the USN, begun in the 70s, interrupted in the 80s, and then continued in the 90s and beyond, has allowed piracy - like off Somalia - and rogues (e.g. Iran) to pop up and afflict the commerce on which much of the world depends. As tiresome and expensive as being the world's "beat cop" is, the questions are, "If not the USN, whom?" and "If no one, how long before these predators make impossible the commerce on which the world depends?"