In looking at What can hackers do with a wifi password?, it is said:
Simply said, if someone has your Wifi password, they have full access to all connected computers and devices within your network. This can be used to do anything from copy data, monitor your usage, send data (typically virus or other sniffer program), watch you on your own webcam, play music on your computer, and a variety of other things.
This sounds like it means, if the wifi password is obtained, you can somehow end up directly running a program on someones laptop. I don't quite see the connection there though. Wondering if one can outline the pieces to make the connection.
My attempt at explaining how it might work... I'd imagine that first you would sniff the network traffic given that you are connected to the network. Not sure exactly how this works but it is said it's straightforward to inspect packets from connected devices on a network if you're on it too. Not sure what sort of security exists here. But given they are sniffing the traffic, I would guess they could monitor any passwords you send over the network. From there I guess if you use the same password on your computer as on the internet then they could type in the password on your computer remotely somehow. I am all guessing here, I don't see how it's possible. You would somehow have to inject something directly into the computer, which just seems backwards.