It’s a unit of measurement, like pounds, kilograms, watts, or meters. Although there’s quite a few different uses of the term so it means different things in different contexts, none of them really have anything to do with horses anymore. (Good info to have).
Kind of like carats used in gemstone measurements no longer refer to the seeds they were originally named for. The name remains but the unit has been standardized.
Even with cars there’s some big differences when people reference horsepower in different areas, mostly having to do with how they get the measurement and what’s included. (at the flywheel, at the wheels, with accessories, dyno variations, etc.)