I have been wondering for long (and being troubled by this too), that why don't MacBook (like most other laptops), don't connect automatically to the available Wi-Fi like iPhone (and most other phones) do.
E.g. if my Wi-Fi router goes off for 1-2 minutes, both iPhone and MacBook Pro disconnect from it (obviously), however when the network is back, after a few seconds, iPhone is back on network, while MacBook isn't (even after long!).
So I want to know why is it so? And more importantly, how to change that behaviour and make it auto-connect?
You should check System Preferences > Network and click the Advanced... button to pull up the list of saved Preferred Networks. There is an option to drag networks in a preferred order. If your home network is not at the top of the list, drag it up. If your home network is the only network in this list, select it and hit the negative button to delete it, then recreate a new Wi-Fi connection.
Sidenote: If you are using iCloud Keychain, Wi-Fi networks you have connected to on any device also using iCloud Keychain will show up on your Mac and visa versa. This can cause a proliferation of Wi-Fi networks in this list.