The digital audio jack on Macs is held to higher standards that typical analog plugs. The shoulder-to-tip distance on the plug is important. If too long, it can jam the mute switch inside the port to the muted position. That's what happened to you.
Not all plugs are out-of-spec and the cost of the external device has little to do with the quality of the plug. I have a pair of name-brand headphones that will jam the port every time. I also have a set of no-name cheapo external speakers whose plug is a perfect fit.
To avoid futire issues, when inserting audio plugs, have the sound source open and headphones on your ears (or have speakers volumed up ready to go). Insert the plug until you hear normal sound and stereo separation from both channels--then STOP pushing. The jack will not fall out even though it is not inserted "to the hllt."
Here is how my name-brand headphones' plug fits the jack on an older MacBook Pro:

In that position, the sound is proper even though the "stop" shoulder is almost 1/8th-inch rom touching the case.