Network protocols are sets of rules about how computers talk to each other. For example, the HTTP protocol lets browsers and web servers talk to each other to serve web pages to users.
In software security, network protocols are an important part of the attack surface of an application. The attack surface is the collection of all the places where the application takes input, each of which is an attack vector.
One of the fundamental problems of security is correctly handling input, so mapping out the attack surface and testing it properly is critically important. Because network protocols happen in layers, some of the networking code is probably code that you didn’t write.
For example, let’s say you’ve written a web application. Users (and attackers) provide input to your application using a web browser, so the full protocol stack for the deployed web application includes HTTP, probably TLS, TCP, and IP.
The code you wrote yourself handles only the application data. The other layers are handled by third-party code, probably open source components, as outlined here.