They do that implicitly in the comment above the function:
> // Function to monitor network activity (macOS specific)
I'm guessing all macOS computers use exactly the same NIC name, and come with netstat preinstalled?