Since Android version 10 was released, users using this system can share their friends the Wi-Fi password. This can be done by generating a special QR code, the scanning of which will allow you to connect to the network. However, Android developers are working on making it easier to share a Wi-Fi password, and it is possible that some changes in this aspect will appear in Android 12.

The latest reports indicate that a feature called "Nearby Share" may appear in Android 12. It would allow you to directly share the password to another phone without the need to generate a QR code. Obviously, such sharing of the password would only be possible between devices marked as trusted. It is not known yet exactly how this function would work, but for its proper functioning it will probably be necessary for phones involved in the process to have Android system in 12 version.

source