This does not refer to an ambush. These soldiers were hiding because they were afraid of the Philistines. This can be stated explicitly. Alternate translation: "the Israelite soldiers who were afraid and had hidden themselves in the hills" (See: [[rc://en/ta/man/jit/figs-explicit]])