In the US, most "Labeled" fire extinguishers are indicated for BC (essentially oils and electrical), or ABC (which also includes paper and wood).
NFPA sets the standards here. Find their website for further information.
Halon (currently banned due to ozone depleting qualities) has several alternatives (Halotron for example), and would be a good, though expensive, choice for engine compartment, for example. Smaller handheld units next to galley stove
or electrical panel would also be good.
The dry chemical extinguishers, using various soda formulations, have limitations. Their main plus is that they are inexpensive. They are a disaster to clean up and may also be corrosive.
Aqueous Film, also know as foam or AFFF, are an excellent choice, though not widely accepted in the US outside commercial
and institutional use. They both cool the fire and remove the oxygen, lessening the re-ignition of combustible matter. The "Fire Triangle" consists of combustible material, heat and oxygen. Remove any component and the fire stops.
CO2 is good, though perhaps not the first choice and should be used with the understanding that it depletes/supplants oxygen in an enclosed space.
Too often this decision is made on cost. That means that most vessels have sodium bicarbonte/Purple K dry chemical extinguishers on board, when prudence would suggest something better.