If it's really a bunch of network packets, the target computer has to be somehow vulnerable: there has to be something that interprets these packets in a way it's not supposed. The requirements for such vulnerabilities would be:
- Vulnerability Type: Execute arbitrary code on vulnerable system.
- Access Vector: Network (Remote).
- Authentication: Not required.
We can combine these requirements into a CVE Vulnerability Search to see what kind of monsters they are. The vulnerable piece can be your operating system, the network adapter drivers, any program that listens for connections... The attacks are most likely opportunistic and automated.
Another way to inject malware on insecure (WiFi) networks is a man-in-the-middle attack (MITM). That's not sending a bunch of network packets, but replying to something you requested: the access vector is not the network – it's you.
- If you are downloading a file on an unencrypted connection someone can replace it with their malware. They can also try to downgrade your connection e.g. by using SSLstrip methods.
- It's not necessarily you who starts the download: some automatic update can be poorly designed etc.
- The modified content could be targeted against a browser vulnerability: no need to run an executable.