Wireshark captures the data coming or going through the NICs on its device by using an underlying packet capture library.