As long as both laptops can connect to the internet, whether you use a wire to connect one or both laptops or just WiFi, AnyDesk
will establish the connection between your laptops. There is very little, if any, lags between local computers. After AnyDesk confirms both local computers, no more traffic goes through the internet anymore, everything is directed through the local network.
If WiFi at your home is crap, you are likely using a channel that is occupied by other WiFi networks in your neighborhood. Better use a lesser used channel. The best channels to use are channels 1, 6 and 11. In your home WiFi network are, I hope, no WiFi repeaters? Or WiFi extenders (same thing as a repeater, just a different name)? Because those introduce all kinds of issues, like stealing 50% of your available bandwidth or more, extra latency etc. You call it lag, but the proper name for what you experience in your network is latency.
So, if you have the option to connect a network cable to one or both laptops, I would suggest you do that. That eliminates most, if not all, of your latency problems. Network Cables, also known as 'UTP' cable or 'Cat 5e' cable (or 'Cat 6'), may never be longer than 100 meters. But that length gives you more than enough opportunity to hide the cable in nooks and crannies of your house, out of sight of your partner/visitors.
Or do what I did, used an opening in the wall of an AC unit (split) to make the cable "travel" around the house and entered the cable back into the house using the hole in the wall from a different AC unit (split). I currently occupy a house that has 9 AC units installed (a 10 meter by 45 meter house with 2 floors, so 900 square meters). But no-one complains about the cable that runs outside the house and instead enjoy good WiFi throughout the whole house and garden with only 2 WiFi routers.
Because the cable is outside, I could place the WiFi routers optimally, which really makes a big difference. That and hard-coded channels, because the auto-configuration of channels of your WiFi equipment, while many other WiFi networks in the neighborhood are active, is always messy and everyone ends up with a sub-optimal selection of channels, so lots of cross-talk between devices, badly affecting range, bandwidth and latency.
WiFi 6 only comes in new (and not the cheapest models of) laptops. And it requires the routing device in your network to support WiFi 6 as well. So, you'll need to purchase that as well. And isn't the WiFi 6 standard still not completely ratified? You can get WiFi 6 equipment all right, but you'll get equipment where manufacturers have filled in the "gaps" of the WiFi 6 standard with what they themselves think fits. It is unlikely that you'll buy a dud for WiFi 6 equipment (from reputable manufacturers), but as far as I know the WiFi 6 standard isn't finished. They sure take their sweet time with that.