Audio is typically passed into a soundcard's digital audio converter (DAC) as integers representing samples of the audio waveform. For example, a full volume sine wave looks something like this[0]. That signal is perfectly safe to play on any hardware. However, if you take that same sine wave and increase the amplitude you end up with values outside the valid range so you have to cap them. You get something that looks like this[1].
Lopping off the tops and bottoms of the waveform is clipping, and the newly created sharp edges in the waveform are what can damage your speaker. They require a ton of energy to play (producing heat) and in some cases can trigger the buildup of high frequency harmonic oscillations in your speaker's voice coil that can eventually crack it. More expensive speakers last longer but virtually all speakers eventually "blow" under such circumstances.
The trouble is playing waveforms like that once in a while is totally ok and short bursts of very similar waveforms exist benignly in lots of stuff you listen to every day. And while it's trivial to know if you're creating clipped audio, it's very difficult (read: processor intensive) and error-prone to detect it after the fact. When you do detect it, your solutions are to either drastically lower the global volume so the edges have a lot less energy, or distort the waveform to make those edges more smooth. It's really, really hard to avoid false positives though and not end up "enforcing" against audio data that's natural and perfectly ok in moderation.
[0] http://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/Pcm... [1] http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/audio/clippi...
If it's a factor of 2, for example, just take the 3dB volume loss and move on.
I don't see why detecting the situation is so hard, though. Build a simplistic model of the amount of energy dumped into the speaker and the amount dissipated, run the audio through that model, and then limit the volume when the amount still in the speaker gets too high. This would let through small amounts and limit large amounts, just like you'd want. For a really simplistic model, run the signal through a high pass filter, integrate the output, then apply a running average to that. When the running average surpasses a value that indicates the speaker is reaching its limit, cut the volume. I take it that this doesn't work?
Once the signal is more complex than a sine wave things get crazy. The more frequencies in a signal, the harder it is to model the power draw since different parts of a complex curve cause the speaker to act more like the low resistance inductor it actually is. Discontinuities and areas of constant voltage (both caused by clipping) are the worst, and to make things even more fun the amplifier is part of the system and affects things as well.
But assuming you know a lot about the speaker, the amplifier and the DAC you could probably build a model that works well for simple sinusoidal audio, but that doesn't cause problems anyway. All bets are off for anything more complex.
So instead you're left with a few options: buy reasonable gear and don't play crap audio, play crap audio but massively overbuild your system so you lower the risk of getting into the unknowable danger zone that changes depending on what you're playing, or use a bunch of heuristics on a signal and try to distort it in some way so it's less potentially damaging.
The problem with the latter is since you don't know where the line is it's easy to be overzealous and end up distorting lots of stuff you don't need to. Problem with the middle is you either end up with something much larger and more expensive than you need, or you cripple what you have to give you a wider margin of safety. Problem with the first is apps like VLC make it exceptionally easy to accidentally play crap audio. Pick your poison.
Could Dell spend a couple extra bucks for higher quality components and create a wider margin of safety? Probably yes. But at the same time the VLC developers are being reckless by putting a tool into consumers hands that makes it so easy to play potentially damaging audio signals.
Edit: clarifications
> When the running average surpasses a value that indicates the speaker is reaching its limit, cut the volume. I take it that this doesn't work?
No, it might work, but it's really a question of cost, complexity and represents an added failure mode -- something else that can go wrong.