From your question I presume that you know this --> Wi‑Fi 6 (802.11ax) replaces Wi-Fi 5 (802.11ac), which in turn replaced Wi-Fi 4 (802.11n) as the standard for Wi-Fi speed in 2013
The iPhone 11 and later is capable of connecting to Wi‑Fi 6 (802.11ax)
Now the question is what is the router / modem that you are connecting to? If it has WiFi 5 or WiFi 4 the iPhone 11 and higher will only connect to WiFi 5 or WiFi 4 because it has downward compatibility. If the router has WiFi 6 802.11ax it will seamlessly connect to it with WiFi 6.
In other words, if you have iPhone XS, which has 802.11ac Wi‑Fi 5, it will connect to a router with only 802.11ac WiFi 5 even if the router has WiFi 6 (802.11ax).