Measuring hp is like measuring a rubber band, there are systems to measure hp and there are ways to express the individual items.
Horsepower is the "strength" required to execute a certain amount of work, ok, but there are different ways to measure horsepower, especially when it comes to the ICE (Internal Combustion Engine).
There are those who measure "net hp" such as the American Society of Automotive Engineers" (SAE), and they would unhook all ancillaries to the engine, no mufflers, no water pump, no dynamo/alternator, no gearbox, to the extent they would even use an electric oil pump to eliminate all possible sources of external power absorption (consumption) .
This system would give a "SAE net" hp reading, and it is through this system that US manufacturers would claim a certain V8 engine could produce... 390hp. (1970's big blocks everywhere, from the 360 Hemi to the 442 to the 454...)
This includes those UK and Italian sports cars productions up to the 1960s (Italy) all the way to the 1980s (UK)
So a 2-liter 16-valve Triumph Dolomite Sprint was rated at 140hp (SAE net) vs. a 2-liter Alfa Romeo (150 SAE net) vs. a 2-liter Lancia (140 SAE net)
Then there were the Europeans, who would use the German system "Detsche Industrie Norme" which required the engine to be tested with
ALL expected ancillaries connected; not surprisingly the hp reading would be lower, yet often those cars equipped with the "less powerful" engines proved better performers that the "more powerful" SAE net competitors (130 hp DIN BMW 2002 Tii vs. 140 SAE net Triumph Dolomite Sprint)
So, Horsepower may be defined as "the capability of an engine to PUSH a load", hence the capability of a more powerful engine to push a car to a faster top speed vs. the same car with a less powerful engijne - you have to push through wind resistance.
TORQUE... hahaha, define that !!!
Torque is the "twist momentum", i.e. the capability of a crank to operate a pulley, or... of an engine to gather speed (rpm) under a defined load.
So, an engine with 100 hp and "X" torque will accellerate the 1/4 mile with a certain time and exit speed;
BUT
equip the same car with an engine which, with the same hp, delivers more torque, and that car will accellerate through the gears faster and exit the 1/4 mile quicker, because the engine with better torque will labor less and gather rpm faster.
As an anecdote... did you know that the average saddle horse will only develop 1/2 hp?
That's because, when first asked to measure the "power" of a steam engine, physicists used the huge "draught" (draft) horse, the large (generally stallion) with thick, feathered legs and woolly hooves used for towing large loads.
A normal "stock" horse is only half as powerful in mucle terms, hence is 1/2 hp.
Pictured, a logging horse and Mutt & Jeff