How do you change iPhone battery without stopping apps?

I recently had my iPhone 6S battery replaced (I think). It was not at an Apple Store. The day after I got my phone back, I noticed that it was still running apps that I had not used since getting the new battery. How could this happen? Is it possible to change the battery without powering off the phone? Can you leave the lightning connector in, connected to a charging cable, for example?

My first suspicion was that they did not change the battery at all, but it seems to be working well, so I am just curious as to how they could do what they did.

I think its a feature.
If you restart the phone, the list of previously running apps is restored.

The iPhone doesn’t have a list of running apps. It has a list of recently used apps, which saves a screenshot of what the app looked like the last time you used it.

Yip. Or, to be more precise, its a mixture of running apps, suspended apps, and stopped apps. The way both iOS and Android work, an app will be suspended if other apps need the CPU, and will even be removed from memory if memory is needed. The apps just save their place.

The task switchers do not distinguish between running, suspended, or stopped apps.

(On Android, you can restart an app by removing it from the task switcher and then relaunching it. I don’t know if you can do that on iOS.)

So if you remove the battery and install a new one, does it restore the screenshots so you see everything if you double-click home?