It not just preventing swapping; OS X, like all modern unix variants, uses extra RAM for disk caching (and hitting your hard drive for any reason is the slowest operation around). In fact, it will swap out old programs to have more space available in RAM to disk cache files/modules/resources relating to open programs (which is why there is comparatively little harm in leaving programs open; they will get swapped out if left idle).
RAM is the single best value upgrade you can make on your Mac, at least up to 2 GB. Past that point, it does begin to depend on your program use - do you use programs that regularly mmap() more than 2GB net?
Example:
I'm using Omniweb 5 to view this website (and have over a dozen sites open in tabs on a few windows). Its memory use is around 100MB. It's mmap()ed memory use is 500MB. What are those 400MB? Memory-space entered access to cache files, preference files, etc. OW doesn't try to load them into RAM; instead it "maps" them to the memory space and would (theoretically) hit the hard drive for any read or write operation - except that almost certainly the disk cache will clone at least part of those files.
-RS