The Americans, especially, really seemed to have issues landing any aerial torpedo hits early in the war, and that's considering if the torpedoes would even go off. Is this because aerial torpedo work is an especially difficult? Seriously, this is area I've little knowledge.
Aerial torpedo training early in the war didn't explicitly include the fast mental footwork needed to calculate by how much, during the time between your drop (or when you're spotted, if that differs) and when the torpedo and present target paths converge, the target might be able to be at a different location as of that intended convergence time than where you expect them to be; and how short you need to make that time-between-drop-and-convergence (i.e. how close to the intended convergence point, but of course always farther away than the minimum depth-stabilization-and-fuze-arming run distance) so that the target is hit even if they maximally change their course and/or speed.
You also evaluate where you are, and the water depth. All aerial and surface-fired torpedoes usually dived to a considerable depth, then rose to their set depth. That might take multiple hundreds of yards. A torpedo dropped in too-shallow water would hit the bottom and be thrown off course, or damaged, or just stick in the bottom and be lost. A torpedo dropped too close to the target likely would run under it, because it wouldn't have risen to set depth yet.
This illustration shows an attack by a motor torpedo boat, but exactly the same techniques were used by torpedo planes. You estimate the target's speed, you know what your minimum run is (which depends partly on the sea state), you know what run depth and speed your torpedo(es) are set for, and you judge how much defensive fire there is already or is about to begin in regard to how close you can get before releasing your (first, if multiple) fish. Given those parameters and the angle between your attack course and the target's present course, you do a mental calculation of the offset angle that defines your firing point, and you continually measure (or mentally judge, but measurement is more accurate) that angle as you rapidly close on your drop point.
If you have time and knowledge, you identify the target ship and mentally recall its propulsion capabilities and rudder authority, and calculate whether your attack will be defeatable if the captain / helm is maximally aware and the engine room and rudder crews are sharp.
What the target should do upon seeing that a torpedo attack is coming is change its speed and course. Almost all ships slow down much more readily than speed up, so what most ships should do is command their engine room to do an all stop and then emergency astern, plus a rudder command for full rudder to turn toward you (because a turn toward the incoming torpedo is more likely to cause a miss than a turn away).
(The reason why torpedo bombers and MTBs usually didn't try attacking destroyers is because destroyers' tactical radius...their tightest turn...is likely to be shorter than your torpedo's minimum arming and stabilization distance. So, if they were paying attention and not stopped or for some reason at very slow speed, you couldn't possibly hit them because they easily could be nowhere near your intended convergence point.)