ESP8266 still connects to wifi even after flashed with empty sketch
The Espressif esp8266 SDK remembers the SSID and password on flash to start connecting immediately after boot. The WiFi channel is stored in the RTC memory (cleared on power down) 

You can control this with WiFi.persistent() and WiFi.setAutoConnect().