the machine gun was the most effective weapon because it forced armies to completely change their tactics. Before the advent of the machine gun, a determined infantry could take an enemy's infantry position by a frontal assault. It might be costly but if it was important enough it could be done. The machine gun put an end to that tactic. The machine gun was the reason armies were forced to dig so many trenches in WWI.
hope that helped