It happens when you connect to wifi. Then Android does a connectivity check and requests a HTTP 204 from a Google server in california. If the wifi is an open with portal login, then the window appears. Otherwise nothing happens, but the connectivity check happens everytime you put wifi on. If you want to disable this, you need to do following command:
settings put global captive_portal_mode 0
You have to re-enable this, if you want to connect to a network through a captive portal. Otherwise you can coose any other server for connectivity check with this commands:
settings put global captive_portal_http_url $URL
settings put global captive_portal_https_url $URL
For example noisyfox generates HTTP 204 (http(s)://www.noisyfox.cn/generate_204). Thats how Copperhead OS solves this issue