Plug a MacBook into a dock with an Ethernet port and it can be on the cable and on Wi-Fi at the same time. macOS then tries the connection at the top of its service order first, and I’d want that to be the cable.
In System Settings, click Network, open the Action pop-up menu and choose Set Service Order. Drag the services into the order you want and click OK. The top one is tried first, the rest follow in descending order.
The Terminal version shows the order with the device names next to each service, which helps when a dock adapter has a vague name:
networksetup -listnetworkserviceorder
sudo networksetup -ordernetworkservices "USB 10/100/1000 LAN" "Wi-Fi" "Thunderbolt Bridge"
An asterisk in the list marks an inactive service. Copy the names exactly as the first command prints them, with quotes around names that contain spaces. I’d name every service in the new order, so nothing ends up in a spot you didn’t choose. The service names above are only an example; yours will differ.
Why bother? A wired connection to your router is usually faster and steadier than Wi-Fi, which you notice with big transfers to a NAS or an Unraid share. Wi-Fi stays on as the fallback, so when you unplug the MacBook it simply carries on over Wi-Fi.
The caveat is VPNs. Apple says you can’t change their position because VPN connections already take priority over the rest, so a VPN that’s connected keeps winning whatever order you set. If you want a different order at home and at the office, Apple’s answer is a separate network location for each.
Further reading: Change the order of the network services your Mac uses (Apple), networksetup man page (SS64, macOS)