Final answer:
The component that allows a device to connect to a network is the Network Interface Card (NIC), used for both wired and wireless connections.
Step-by-step explanation:
The hardware component that enables a device to connect to a network medium, either wired or wireless, is the Network Interface Card (NIC). A NIC is a computer hardware component that allows a computer to connect to a network. It can be used for both wired connections, where it often connects via an Ethernet cable, and wireless connections, where it is typically built-in or attached as a wireless card or USB device. Modems are used to encode and decode information between digital and analog formats for communication over telephone lines. Routers are devices that forward data packets between computer networks, creating an overlay internetwork. Hubs are simple network devices that connect multiple computers or other network devices together.