When you listen to stereo speakers, you always hear both channels with your two ears. Headphones don't have that problem; the left channel is only heard by the left ear, and the right channel only by the right ear. That's why stereo sounds smaller over headphones, and of course, it's all, or mostly, in your head.
And once the sound is there, the headphones' job is done, but with speakers, you're always hearing the speakers' sound, plus the sound bouncing around the room. The closer you are to the speakers, the more direct sound you'll hear, and less of the room's sound.
That's what I love about desktop speakers; at home, my ears are about 28 inches from my Emotiva Airmotive 4 speakers. Their sound approaches the directness of headphones, but the stereo image is still in front of me.
Stereo over headphones never sounds as realistic as it does over speakers. But room acoustics and reflections always diminish the accuracy of speakers' stereo imaging. So headphones' biggest advantage is taking the variables of room acoustics completely out of the picture, and that's great, but unless you listen to headphones in very quiet places, environmental noise will mask some of your headphones' sound.
That's true even with noise-canceling or isolating headphones. They reduce but can't eliminate noise; the very low-frequency rumble of a plane, train, bus, or car is always there, covering a lot of your music. Midrange and treble noise also intrudes, so it was an ear-opening experience to hear how much different a given set of noise-canceling or noise-isolating set of headphones sounded on the NYC subway vs. my apartment. The only way to get around that is to listen at a very loud volume to cover the noise. Crank up the volume to cover the noise and you'll risk damaging your hearing over the long-term.
No headphones can ever compete with a big tower or subwoofer for bass punch or impact. I have to admit that sound quality isn't a big priority when I'm on the street or subway; there are too many distractions to ever really focus on the sound, compared with the way I listen at home. I'm always amazed by folks agonizing over what sounds better, lossless or MP3 files on an iPod because once you're out in the noisy world, sound-quality issues are dwarfed by everything around you. Home listening over speakers is, for me, a much better experience. That said, I really love the detail and clarity of a great set of headphones.
Where you stand on the headphones vs. speakers question might depend on your age. Under-30 folks tend to favor 'phones, and over-30 types are more likely to gravitate to speakers as their primary music-listening source. Right, price plays a big role, and I have to admit that's one area where headphones always trump speakers.
You can get an amazing-sounding set of headphones for $100; to get an equivalent level of quality from speakers you'd need to spend three or four times as much. The world's best headphones top out around $2,000-$5,000; extreme speakers go for 50 times more. It's the same story with headphone amplifiers vs. speaker amps. Headphones are the least expensive way to get a great sound.