The Japanese really had outstanding torpedoes. Even if somewhat inferior, the American torpedoes had about the same range as the main and secondary batteries of the Japanese guns.
At range, the destroyer at high speed could turn upon seeing a Japanese let loose a salvo and evade the incoming rounds. Every torpedo launched by the destroyer would force evasive maneuvers by the battleship.
True, but then both sides begin to guess the other's evasive maneuvers, and eventually (skill / intuition / luck) will guess right, and when a battleship's or heavy cruiser's main batteries hit a light destroyer, much less a destroyer escort...
Except... The Japanese for whatever reasons thought they were engaging much larger ships, shelled accordingly, and their armor piercing shells often went right through the light "tin can" US ships, holing them but not doing large round explosive damage. This probably further confounded the Japanese: "We missed!" "What? Again?!" "See for yourself! No new explosions or fires." "Adjust!" This and superior US fire control helped even the odds a bit further.