Captain Sir Edward Pellew, who had been knighted in 1792, was made baronet in 1796 for distinguished service in command of a frigate squadron.
In more modern times, Air Chief Marshal Sir Arthur Harris was made baronet in 1946 for his services as commander of Bomber Command in 1942-45.
Context is everything. Pellew's baronetcy was regarded as an honour; he would earn many more, including a peerage. Because Harris received his baronetcy at the same time his counterpart commanders in the Navy, Army and Fighter Command received peerages, it was regarded as something of an insult to him and his men.