There are many reasons for this problem; one of the reasons is that Windows Update failed to install or update the Network drivers, in that case, you have to update the required driver manually.
Windows 11/10 includes a feature that lets you reset your network and fix connectivity issues with a click. Network Reset will reset Network settings and components to default and reinstall your Wi-Fi ...