An iOS device will only connect to known networks. By enabling “Ask to Join Networks” it will list networks and ask if you want to join any of them – but only if no known network is in range. This is actually less safe, in that you're just a button press away from “accessing random open networks” instead of having to go into the settings and choose a network – so it makes sense to have it default to off.
tl;rl: iOS will only join known networks – toggling this setting will make it easier to join networks when no known networks are in range.
tl;rl: iOS will only join known networks – toggling this setting will make it easier to join networks when no known networks are in range.
edit: Link to the relevant section in the manual: https://help.apple.com/iphone/8/#/iph1b489c85f