If you close your eyes, how do you know what direction a sound is coming from? Your brain processes the difference in time that it takes for a given sound to reach each of your ears, giving you a sense of direction to the sound's origin.
To produce 3D audio, we digitally record sounds in the same way that we use our own ears to hear, by using special microphones, mounted in the ears of a realistically-shaped head. By recording in this fashion, when played back through regular stereo headphones, we can recreate the original environment in a highly realistic 3D sound.
Note that although Audio Serenity CDs sound great through speakers, the 3D aspects of the sound aren't as pronounced as when using headphones.