How it works

Bittorrent isn't your typical "put file up on server, wait for people to download" sort of protocol. It's more of a peer to peer protocol, but one that's designed for reliability and load balancing.

The Tracker

The .torrent files contain the location of a tracker, which is a brokering server that connects users with other users who have pieces of files that can be swapped. It deals entirely in sha1 hashes, and thus has no concept of "filenames". The contents of the files never pass through the tracker.

The Downloader

The key is that users grab pieces from each other. This means that to put a file up available for download, you actually start a downloader process, but with the file already completely in place! This can be confusing when you are used to HTTP and FTP servers, but realize that once you have completed a download, the tracker will know that you have all pieces of the file available for others to grab.

This is why often you'll see torrent sites admonishing users to keep their clients open after downloads are complete. The more people do this, the more widely available a file is. BitTorrent rewards popularity, unlike HTTP and FTP servers, which punish popularity by their susceptibility to bandwidth bottlenecks.

The clients decide whether or not to provide pieces of a file to another client by using a tit-for-tat strategy. That means that the more you upload to people, the faster your download gets. It also means that your client will tend toward the closer (in the network sense, i.e. faster) peer.