If your pc (lets assume windows) is connected via a wired LAN and has a USB dongle that supplies 3G internet, how does your pc know which connection to use when browsing the web? Does linux follow the same rules as windows?
Any time multiple network connections are involved (on any OS), the routing table identifies which connection to use.
I'm going to explain the routing table using a Linux example, but Windows is effectively the same. The main difference is how it labels the interfaces.
Let's say you have 3 network connections that each are connected to different networks, like this:
By default, as your system configures the network connections, it will add routes for each of these networks to your routing table. Here's an example routing table for a server with the connections shown above:
So, if you want to connect to one of those networks, your Linux system will decide which connection to use based on the destination network. If you want to connect to a server with the IP 10.0.0.233, it will use eth0. If you want to connect to 192.168.0.4, it will use eth2.
So, what about networks that aren't specifically listed in the routing table? Well, that's where the default route comes in. Notice the last line in that routing table:
The short version is that any traffic destined for a network that isn't specifically listed in the routing table will be sent through the default route. In the example above, that is eth0, sending specifically to the router at 10.0.0.1.
The longer version is that routing decisions are based on network prefix length. A given packet will follow the route with the most specific matching destination. Here is an example list of networks in CIDR notation that range from most to least specific:
So, given a destination IP of 10.100.6.231, the most specific matching range in the above list is 10.100.0.0/16, so the route for that network would be followed. If the destination is 126.96.36.199, the most specific matching range is 0.0.0.0/0 (which is the default route). Once the routing decision is made, then the system will send the traffic down the appropriate network connection.
This got a little long-winded, but I hope that it explains things. In general, the default route decides what connection internet traffic will go through. The default route is configured differently on Windows vs Linux, but ultimately everything works on the same underlying routing mechanism.
Windows using binding order.
This is basically an ordered list of connections to try. Windows will try the first connection, and if unsuccessful will go to the next, etc. For internet it will almost always use the first. The second connection may be used if you are on a LAN and a WAN, and the second NIC connects to a certain IP schema (192.168.4.X for example) that is not a part of the first NIC.
I don't know enough about Linux networking to address that, but some quick searching shows it may work similarly. I'll check some more and come back with an edit if I have a definitive answer.
baumgart's answer below is better for Linux...