All these commands:
gpg work in a a stream-like way: they take a chunk of data (let say one megabyte), transform it and push it to the next stage. After that, RAM is reused to take care of another chunk of data. So even if you have a terabyte of data to process, it will be processed piece-by-piece.
Now, when you call
tar by itself, tar will work this way: read one chunk of data from disk, wrap it with some headers necessary for archiving, push it to disk and forget about it. And again. And again. In this process, you'll never need more than one chunk of data in RAM. I don't know how big will
tars buffer be, but it will be probably few megabytes only. So you will need only few megabytes of RAM to make it work.
bzip2 work the same way.
gpg takes a small chunk of data, encrypts it and pushes forward -- all in a loop.
bzip2 takes a small chunk of data, compresses it and pushes forward -- all in a loop.
You will need less RAM if you will call these commands without a pipeline: you will need to keep only one chunk of data at the same time in RAM. With a pipeline, chunks of data will be passed from one command to another, keeping it in RAM: you will need few chunks of data: one for
tar, one for
gpg, one for
bzip2. So several megabytes tops. You will not need RAM to store all data at once.
With pipelining you can actually get another benefit: speed. You don't need to store temporary data on disk. Chunks of data get passed from
bzip2 and from
gpg using RAM only. Compare: 3GB of data, 3GB of data in a tar file, 1GB of data in a tar.bzip2 file, 1GB of data in a tar.bzip2.gpg file. Even if you don't store them at the same time (f.e. removing source files in the process), you still need to write and read 4GB more data to disk than in a pipeline version. And VPSes are usually quite slow at disk operations, so a pipeline can spare you lot of time.
(Note: this explanation is simplified. All these commands do keep some additional data in RAM, but this is rarely significant. Also, you can often change size of buffers in specific commands.)