"In 1839 [...] the United States had already defeated Britain’s navy in two wars"
This statement is wrong and trivially falsifiable. Perhaps the author meant that the U.S. had by that point won some naval battles against the British?
I completely fail to recall that time we burned down Buckingham Palace. https://en.wikipedia.org/wiki/Burning_of_Washington
We did flex quite a bit on lesser powers, though, even in the 1800s. The US Navy was infamously rebuilt after the revolution to fight a war against Tripoli.
https://en.wikipedia.org/wiki/Treaty_of_Tripoli
https://en.wikipedia.org/wiki/Barbary_corsairs
https://en.wikipedia.org/wiki/Barbary_Wars
Before the end of the century we'd fought a hundred or so largely forgotten wars. Who remembers that time we invaded Korea? No, the other one.
https://en.wikipedia.org/wiki/United_States_expedition_to_Ko...
Or Fiji? https://en.wikipedia.org/wiki/1858_Fiji_expedition
Or New Orleans? https://en.wikipedia.org/wiki/1811_German_Coast_uprising
yeah, it's worded strangely; as if both conflicts were exclusively/divisively maritime.
Which is a shame because the role of the Colonial Navy and later the U.S. Navy in the war of independence and later in the War of 1812 is actually fascinating and often overlooked
John Paul Jones, for example had an amazing (as in interesting, not 'goodly') life ( https://en.wikipedia.org/wiki/John_Paul_Jones )
And the Battle of Lake Erie https://en.wikipedia.org/wiki/Battle_of_Lake_Erie