> I would imagine the software does that.
Obviously the lithium-ion cells themselves aren't doing the computation; software is. But the software should be considered part of the "battery" as a system. Without the software the lithium-ion cells are useless for this application, and indeed for any application more dynamic than a flashlight. So the software development that Tesla has done is essential for making batteries viable in the sorts of applications that people want to use them for to help solve our energy problems.