ESP8266 device connect to strongest WiFi

I have now rebooted the AP which is the closest to the ESP07S device and strangely it now seems to have connected to that AP rather than the further away located (and weaker) main router's WiFi.
It has been on the stronger signal now for more than 19 hours...
Strange, I would have suspected that while the AP rebooted the ESP would have connected to the router instead and stayed there afterwards. But it seems like the opposite happened.