macOS has a big problem with Wi-Fi on some M1 and M2 Macs. Meter, a company that specializes in setting up Wi-Fi networks for businesses, and the University of California have both reported connection bugs on these machines (ici, to be). Either way, Apple is aware of the issue, and an upcoming macOS Ventura beta should include a fix.
Symptoms are Wi-Fi speed drops, network disconnections, or the inability to connect to it in the first place. The culprit has been identified, it is the AWDL (Apple Wireless Direct Link) interface that allows AirDrop and AirPlay to work. Currently, the only way to regain Wi-Fi stability is to turn off Bluetooth in Control Center or System Settings, and select the option Nobody in the AirDrop window:
Obviously, it is very disabling in everyday life. macOS 13.1, whose final version is expected very soon, might it bring the expected fix? According to UCLA, it should be.