This was the original concept behind the Matrix, but ‘90s studio execs thought the average person wouldn’t understand and made the humans just be “batteries” instead which makes much less sense.
Edit: found a pretty good reference for it being true: https://scifi.stackexchange.com/questions/19817/was-executiv...
https://news.ycombinator.com/item?id=35069121
Anyway this will remain in my headcanon, simply because the whole thing makes no sense otherwise