(What Soren said is not completely true.)
What traffic (or packet to be exact) goes through the VPN is decided by the routing table of the client computer for VPN services that tunnels the 2/3 layer (commonly Ethernet or IP).
On both Windows and Mac OS X, you get the option in your VPN connect to send all traffic through the tunnel or just the traffic that belongs to same subnet assigned to you by the VPN server.
For example, assume you currently have IP 1.2.3.4 and connects to your company network which uses the subnet 192.168.1.0/24. When you connect, your OS will automatically install a route to send all traffic to that subnet (192.168.1.0/24) through your VPN connection. So far, traffic to an IP outside that subnet, e.g. 3.4.5.6, will be sent directly without going through the VPN.
If you choose to send all traffic through the VPN link, the default gateway on the client side will be changed. And traffic to 3.4.5.6 will go through the VPN
Also, like Soren said, a VPN tunnel does not "physically" connect you to the remote network, so all traffic has to go through the VPN server. Logically, the VPN server is a network bridge or router which filters network traffic and only sends the ones that are "interesting" to you.
1This is true, even if you establish a SSH or HTTPS connection over the VPN.. I.e. the VPN does not care that traffic is already encrypted, it will apply yet-another layer of encryption on the traffic. – Soren – 2011-07-20T00:47:10.580