What juanrdp says sounds very plausible.
On the inside the headphones jack is a spring-metal "circuit breaker" which effectively disconnects the laptop speakers when a jack-plug is inserted, when you remove the jack-plug the spring-metal contact closes the circuit again to restore audio to the speakers.
The spring-steel contact may have broken, or it may just have become distorted/bent so it's not closing the circuit like it should.