It doesn't need an app to set up over Wi-Fi, that's one advantage of this technique. It works like this:
- Device acts as access point: either open, WPS or showing the password/QR code on screen
- Connect phone (or computer etc. with browser) to the access point
- The phone will try to connect to a known domain (for example http://connectivitycheck.gstatic.com/ on stock Android) to determine if the AP has Internet access. If this doesn't work, go to an HTTP-only site: http://neverssl.com/
- The device will hijack the unencrypted HTTP request and redirect to http://192.168.1.1/setup.html or whatever (this will be detected by the phone as "captive portal" and you get a "Sign in to Wi-Fi network" notification (the phone believes it may then access the internet because some Wi-Fi hotspots do this)
- You input your home network's credentials into the webpage so you don't have to dial them in with the volume knob and tiny buttons
- The device disables its setup hotspot (if only one Wi-Fi radio is available) and tries to connect to the provided network (usually there's a timeout so the process restarts on failure)
This is very common, I made an ESP32 device whose setup works like this. If you need to make an open Wi-Fi network for whatever reason, you can name it "HP Deskjet Pro 4800" and it's very unlikely someone searching for public Wi-Fi will try to connect