They wanted to go for the idea that machines were harvesting our conciousnesses as a collective VM to run the matrix on, but thought the idea was to complex for the audience to understand so they went for the battery instead.
Ironically, the VM thing makes way more sense than the battery one.
This was deemed to confusing for audiences to understand, so the story was changed so that humans became the power source for the machines. Since humans take in a lot more energy (food) than they produce as heat (or “bioelectric power”), this makes zero sense. In a future world driven by physics as we understand it, the machines would be better off killing all the humans and using some other power source.
The brains-as-CPUs version of the story is both physically plausible and a lot more interesting than the humans-as-batteries version. So some Matrix fans maintain that this is what was happening in the movie, with the human battery explanation just Morpheus’s misunderstanding.