The first thing that has to be understood is that HP can't be directly measured, it's a calculation made from the two things that can be measured which is torque and rpm. Now torque is a product of a force acting over a distance (for instance, your hand at the end of a spanner tightening the prop nut) and an engine works in much the same way. In the case of an engine the force comes from the combustion pressures acting over the top of the piston and the leverage comes from the rod acting on the crankshaft (this is a little simplified but the general principle holds).
This combustion pressure depends on the volumetric efficiency of the engine, in other words, how good it is at getting in the largest amount of fresh mixture to ignite. This means that you need to get rid of all the burnt gas and completely fill the cylinder with a fresh mixture without losing any out the exhaust before the port closes. However, this can only happen at one particular engine speed because of the fixed port timings (which in any case are a compromise). If the engine is running at a speed below the optimum then there's time for some of the fresh charge to escape out of the exhaust so less pressure will develop at ignition so reducing torque. If running above the optimum then not all the exhaust has time to get out and not all the fresh charge has time to get in which also reduces torque. Keeping that in mind, as the revs increase from below the optimum the combustion pressures begin to rise and so does the torque until it reaches it's maximum efficiency. From there on the efficiency decreases again and the torque begins to fall. This is where we see those torque curves which rise up to a peak then begin to drop off. They're really an indication of volumetric efficiency at various revs.
So much for torque, now what about horsepower? Well as I said earlier, HP is calculated from torque and revs. Twice the torque at the same revs will give twice the HP and twice the revs with the same torque will also give twice the HP (Torque x revs = HP). If you take a graph of the torque curve and multiply by the revs at any point you'll end up plotting a graph for the HP of that engine. But one thing that'll soon be noticed is that the HP keeps rising for a while even after the torque curve begins to fall. The reason is that the revs are rising at a greater rate than the torque is falling off. But there comes a point where the torque begins to fall away faster than the revs are rising and this is the peak HP for that engine.
These are just the basics but hopefully it shows that it's possible to have an engine with quite low torque figures that develops high HP if that torque comes at high revs, not what we'd want for PA work though. It might also be noted that flywheels didn't come into the discussion either 

