EphemeralPermanence
I was wandering how is running in background regulated in terms of networking?
It's not directly connected to networking at all. It's whether a profile can run after you switch away vs. the session being ended.
I know that DNS resolver is always taken from the admin account.
No, this isn't accurate. Private DNS is configured globally but that doesn't mean the function of it is global.
So does the user account use its own networking scheme in order to fetch notifications and deliver them to other account? Or is it using the network of the current user account?
This doesn't involve networking.
What happens with internet access if I turn it off and then switch account?
If you disabled it running in the background, that session is ended and nothing is running anymore. What's the relevance to internet access?
I noticed that saved wireless networks got transferred to my newly created user account. Also when I switch from account to account if wifi was turned on on the current account it will stay turned on on the second one. Is this normal and expected?
Wi-Fi configuration is global because there's a shared Wi-Fi radio for the overall device. Android supports disallowing secondary users from changing global configuration like Wi-Fi via separate toggles. Most of these these toggles aren't part of the standard Settings UI but we did add a few beyond what's usually there. We didn't add toggles for whether secondary users can control Private DNS, Wi-Fi, etc. but there are under the hood toggles available to device policy manager apps.