Depending on what sort of headphones you’ve got going into your MacBook, you may have encountered some trouble keeping the things plugged in. It seems that unibody MacBooks are a bit picky on just how far in the headphone jack has to be.
Users claim solid performance with the latest iPhone-compatible headphones with the built-in mic, but older headphones (including Apple ones) tend to disconnect with the slightest jar. Sounds to me like the headphone jack gripper (below) at the very end isn’t in the correct position. It’s possible, I guess, that if it isn’t secured well that it might be knocked out of place or loosened by rough usage.
Well, that picture really is quite big.
Anyhow, that wouldn’t really explain why some headphones work and some don’t. Either way, it seems some people have success with an adapter like this iFrogz one, at least if you don’t need the microphone functionality.