It uses it's routing table. If the destination is on the same network, it transmits directly via the MAC address. If the destination is on another network, it transmits to whatever the table says for that network. For desktops it's usually a default address of the router on the computer's network.