Since swapping takes time that could be used doing something else, computers with more RAM run faster, up to a point. Since a computer with more RAM can give programs larger amounts of space to store their running code, it needs to spend less time swapping. If the computer has enough RAM to hold the entirety of the running programs, however, adding more RAM to the computer will not speed it up. That is when the processor speed becomes an issue. A computer with too little RAM is not limited by the processor, but by how fast it can swap program chunks into and out of memory. When it does not have enough RAM to hold the program chunks it needs to complete an operation, it can become locked into swapping data into and out of RAM, doing nothing else. This is called "thrashing" and it slows the computer down to the point of complete uselessness.
Linux was designed on very old machines with very small amounts of RAM; it can run on as little as 2 Megs of RAM, although this is not recommended. However, because it was designed to work with such small amounts of memory, it makes use of a process known as "virtual memory." Virtual memory is space on the hard drive that is treated as if it were RAM. This means that the computer pretends that the hard drive is RAM for some programs. Because the swap partitions are limited in size and the computer knows exactly what is contained in them, it can access the information on those portions of the hard drive much faster than it would normally access the hard drive. However, access speed on the partitions is not as fast as the access speed in RAM.
Linux was designed to require twice as much virtual memory as actual RAM; this should be taken into account when partitioning the hard drive. During installation, Linux creates "swap partitions" to be used as virtual memory by the OS later on. These partitions are specially formatted for their purpose, and cannot be used as storage space on the hard drive for anything else.