A Destroyer is a type of Starship
The destroyer is a ship that came into being with the invention of the Whitehead torpedo. Suddenly a small boat could pack a punch that could sink a capital ship. Something had to be done. The result was a slightly larger and faster ship called a "torpedo boat destroyer". The "torpedo boat" part of the name got dropped, but the purpose of the type has not changed. Destroyers are picket ships. They protect larger ships from threats. The job of the destroyer has expanded from torpedo boats, to submarines (the torpedo boat under water) to anti aircraft pickets.
In the 23rd century the destroyer was a light warship designed to escort other ships and conduct independant patrols. It was a war of attrition unit. The types and missions of destroyers proliferated in the 23rd century. Destroyers almost always focused on anti-starship missions, but some were hacked into Bombardment ships and experimental weapns platforms.
Destroyers were primarily military starships, their ability to do science and exploration was discarded in favor of military operations.
In the 24th century the term "Destroyer" was discarded as being too liable to cause problems when run through a universal translator, too aggressive sounding and too Earth-centric.
The roles filled by destroyers in the 23rd century are now called Escorts.