WIFI hacking is of many types, in which it can broadly divide it in two ways. Either one has hacked your WiFi directly and connected to it. The second is that he hacked your WiFi and accessed the device connected to it. That's what hacker is aware of what you are doing.
Hackers often use WiFi to leave it open and use it as a bit. You have connected WiFi without password and are using the internet. As soon as you connect to WiFi, your device's MAC address and IP address are registered in the router. Hackers first intercept the traffic by using the sniffing tool. Data is transferred as packets, and hackers have many tools that can easily detect your browsing history by intercepting these packets.