This is similar with the Automatic Setup feature, however Wi-Fi sharing works anytime while importing data automatically from an old iOS device to a new one can be done only when the iPhone or iPad is configured for the first time after purchase or a major software update.
iOS 11 Wi-Fi Password Sharing Tip
1. Open the Settings app from the Home screen of your iPhone or iPad.
2. Tap on Wi-Fi and allow your device to scan for the available networks.
3. Tap the network that you want to connect to.
4. You’re prompted with the Wi-Fi Password input screen. Now, it’s the time to bring around the other iOS device that is already connected to the selected network.
5. A card slides in from the bottom of the connected iPhone or iPad asking you if you would like to Share Your Wi-Fi.
6. Tap Send Password to share the info with the nearby device.
Fact: The sharing iOS device has to be unlocked for this feature to work!
Info: The feature is also available on the new macOS High Sierra operating system allowing macs to share or receive Wi-Fi Password.