The alliance between the Israelites and Abimelech was built on pure self-interest rather than genuine loyalty. The Israelites originally joined his camp because the military campaign offered a convenient opportunity to conquer their rival city of Shechem.
Because this partnership was strictly practical, the moment Abimelech died, the entire dynamic of the battle shifted. The military operation suddenly lost its leader. Without an alternative commander stepping up to guide the fight, the army had no reason to stay together. Consequently, the camp completely dissolved, and every man abandoned the battlefield to return to his own home.