In the original draft, the machines were using human brains as a networked computer. The simulation is necessary because sensory input and simulation is how human brains compute - it's for the humans, not the machines. Unfortunately the studios thought that was too complicated and we wound up with "lol batteries" and none of it makes any sense.
Also, I mean, because without that there wouldn't be a movie.