The good news is that there is a pretty reliable way to resolve the issue. Mac users often encounter a situation where WiFi doesn’t reconnect properly after waking from sleep mode. You can use a WiFi analyzer app on your smartphone or computer to see which local WiFi networks are using which channels and then set your router to use one that’s relatively uncontested. Channels 1,6 and 11 are popular choices for the 2.4Ghz band, because they don’t overlap. However, it can happen that a router has its channel manually set or that, for some other reason, there’s just too much competition to find a good channel.
So, usually, your neighbour’s router will automatically use a channel that doesn’t have anything else happening on it. There are 11 and 45 channels on the 2.4Ghz and 5Ghz frequencies respectively.
All WiFi systems operate at the same frequencies, so why don’t they clash with each other? The answer is that they use “channels”, which break up the main frequency into small, narrow channels.