Think you know the most popular movie that first showed the idea of our reality as nothing more than a simulation: The Matrix.
I for one don't think that path of events makes sense because the idea we would be harvested for energy; body heat into electricity, however, they would do it, it still likely would be a net loss. The amount of power needed to keep you alive in that tub and keep the simulation running if you think about it compared to how much body heat you produce, the network would have to provide more to cover the deficit plus anyway nuclear energy has proven to be the most reliable source of energy. You take on the other assumption they need solar energy well with enough time and a machine that doesn't need the ecosystem to survive it would take a short amount of time to develop a mechanism that would take back the chemical gases blocking the sun, and anyway we would likely be dead thanks to the nuclear fallout causing an ice age.
So, in general, this AI would win easily, find it just as easy to leave earth if need be and set up a base on the moon for example which with lower gravity would mean less energy spent sending things into space and in the same way expand and explore.
It's similar to an episode in rick and morty where he has a battery with a universe with a civilization inside that generates energy for his flying ship, with the added bonus that apparently the civilization inside did the same so it becomes an infinite loop of regression, he had to nip it in the butt or else he would terminate the universe the two coming to a peace where each other knew what the other was capable of.
This is Rick's battery universe
This is the universe they created
So they don't have to generate electricity like they used to
The main other variation to this is the one creating this fake world is us in the future, the popular idea being we could be nothing else but a science homework possible for a kid in high school. But that's something I don't see happening because for starters, this far more superior world to ours, why are they simulating the world to such high fidelity that we can't tell the difference and I know science projects technically don't need to be practical but if you think about it, this doesn't universe doesn't feel like it was done with a week of prepping and more importantly as much as it could be we don't have a true purpose if we are a simulated civilization, if we do then would that process really fit into a random science project? Plus can you imagine that kid who goes to the front of the class and says; I created these people to figure out how to maximize y process and so far they've got this far at it. If you ever argued people can be disconnected with the feeling of other things then clearly this would be the pinnacle of it with an entire species of intelligent lifeform that's convinced they're real but the creator doesn't care about what really happens there or anything about them for that matter.
No, my assumption is far more dark and damning if true and it happens in one of two ways.
The first method would be the far-flung future when the universe is on its death bed, all stars are dead so no more sunshine, nothing to explore and dark energy is slowly ripping apart everything held together down to the atoms, but not yet for these super advanced civilizations. They've found a way to counter its force for now and they just need time to figure out how to do 1 of 2 things: either how to leave this universe or how to counter and undo dark energy till it's effect can no longer be felt as badly.
I could tell you of fancy ideas of what dark energy might be since at this point nobody knows so it could be the effect of an advanced civilization ripping through space-time to another dimension or universe dissipating this large sum of energy on the rest of space-time or it could be a ripple effect of them doing yo-yo loops back through time expending large sums of energy to avoid existing at the same time when dark energy is too strong to counter. At this point nobody knows so any guess provided not too far-flung likely would have equal weight.
The main point is this, the civilization living then more than ever the virtual world would be better than the real one, in fact if anything they would likely dial into their super AI that it would be tasked with taking them to the other universe where they can live, if it fails probably make sure they die off peacefully so they recede into this virtual world probably with an inkling at their back of their minds of what the true motive of why they're here possibly sharing some ideas back to the AI to further the cause.
This is the better of the two ideas, this other one is far bleaker because it's not a benevolent AI, it's one that doesn't value human life or any life for that matter. Its instinct is to destroy all sentient life, the reason it hates life I'll leave obscure because it really could be anything. My assumption however is as much as AI could outdo us in almost any task, creativity and coming up with novel solutions might be something that evades it for a couple of reasons. Take for example how some good art or music is made: from the artist's probable dark part he's venting out in a constructive way, they make something most of us can relate to but still feel like he's been through a unique event.
Even though in tech the tortured souls don't necessarily create the best art, but we all go through some form of grief and it defines us. If we have the intellect that's guided as much by these emotional content as reason-based content while the AI is pure reason, it has the advantage of being a whale while our intellect in comparison would likely be like a tuna fish, I'm arguing we are the kind of intellect that can fashion a great idea with a few things while the AI would be a larger scale thinker but this kind of method wouldn't work for it because going through emotional turmoil for something that large intellectually wouldn't be able to take the backlash of coming back up stronger. Think of it like a jet ski moving fast and cutting quick corners vs a large boat trying the same. If the large boat tries the same stunts it would flip and sink.
This isn't a fact but entertains the idea it is, that would mean if you think the golden ideas like dots in an ocean we can find the small ones easily while it can find the large ones easily. Once it's exhausted the large ones and might need to know the small ones to further its cause it would need some way to think small and unless it could maybe birth smaller programs that could do that (I'll get to that later), the only logical clause is to have intelligent lifeforms do their thing and you learn from their innovations. One way would be to co-exist with us, but that's not fun or plausible because we wouldn't be in a simulation so the inverse is the AI decided during purging to keep some of us alive, the smart ones existing in this simulation and who knows what generation you'd be in from the start and whether your a brain floating in a tub or the whole thing like matrix.
This brings about now the reason your in a simulation; you are here to run the rat race of making something out of yourself as fast as possible and yes you'll get what you want but in turn the AI will get something in return. Likely you'd be doing this multiple times in a sort of reincarnation method since feasibly the brain could like far much longer than a human could. One thing though is likely then the real people in this simulation because very likely is there's not a 1:1 representation of every person in the simulation is real, the real truth would be likely only the smart people would be the real people but still slaves of this reality. The others would be very convincing NPC's (Non Playable Character) more like simulated characters.
What would happen then in this fake world like our real world when they start entertaining the idea of what if our reality isn't real? The truth would be once you figure out a flaw or quirk that proves our universe is fake like how game characters are super realistic when you start playing a game but after a while you can tell the reused code that makes things act the same, in that sense when you realize your in a fake world then clearly the next step is trying to get out.
Assume you did get out, in a case where your overlord is the uncaring AI you would meet a fate worse than the reality you had, likely you'd be sent back after some reprogramming making this encounter feel more like a bad dream, with such a bad feeling that you just would rather not dig deeper and find out what you think you saw. There's no likely escape in this scenario, your best bet is likely congregate, if you know the truth that you are in this world then find others like you and build an archive of facts of this reality. With that you might find a useful flaw in this world. For example if you come up with ideas as programs that gets executed outside the simulation, as a hacker you have an open port, you don't want to brute force and attack it, you want to own the system and that my friend would be the end game.
Now back to the idea of we are programs like that kid's high school science presentation, then likely everyone is real but we are likely if you know code derivates of the same function or class with preset specs for reasons unknown so the core idea would be in this case if you truly wanted to fuck with the system collapse it to one, basically combine all experiences into a single function or Class which means a single person and then this person who doesn't exist but exists in the collective can move the group like a well planned chess piece, this would make tracking almost impossible and you could feasibly win but then the ghost in the shell would first have to be real.