Modem
The modem handles the provider-side internet handoff. If that path is unstable, Wi-Fi tuning will not fix it.
This page explains the jobs these devices do in plain English so troubleshooting starts at the right layer. Many networking mistakes come from changing Wi-Fi settings when the real issue is upstream, or replacing a router when the layout really needs better access point placement.
The modem handles the provider-side internet handoff. If that path is unstable, Wi-Fi tuning will not fix it.
The router decides how local devices reach each other and the internet. It is the traffic manager for the network.
The access point extends or supplies Wi-Fi coverage. It improves the wireless path but does not replace upstream routing problems.