The word "confusion" here is used as a casual way of saying the Philistines were unable to think clearly. AT: "made them unable to think clearly" (See: [[rc://en/ta/man/translate/figs-idiom]])
This can be translated in active form. Possible meanings are 1) "Yahweh routed them before Israel" or 2) "Israel routed them" (See: [[rc://en/ta/man/translate/figs-activepassive]])
# routed
To rout people is to defeat them before they can cause any harm.