This "maximum current thing" can sometimes get like crossing the road in germany. You can get arrested for crossing the road if the green 'cross' light is not lit, even if the cars are far away.
THis is my 0.02. The output of a logic device (in general) is literally a switch which either connects to the IC's supply, or to ground, that's what makes a H/L. This switch isn't perfect, it has an inherent resistance present in it. The amount of inherent resistance varies according to what kind of IC it is.
If it's a Line Driver IC (possibly good for a h-bridge too), the resistance is going to be low, 10 ohms, but if it's a "4000 series" IC running of a small battery, this resistance is something like 1000 ohm. The uC we've been talking about I'll guess is about 100 ohm. When you connect a logic IC output to ground and make it try assert a logic H, a current flows, and the IC starts to get hot. In practice it doesn't blow up, but it can burn off its printed number. But having said that another IC, say a 4000 series I mentioned earlier, can drive an LED directly without bothering with a 'current limiting resistor'.
Enter the 'current limiting resistor'. This is the thing that programs what this current is. I won't elaborate any more because in engineering, this is virtually a religion in itself!
The actual "amount of legal current" is a subjective thing anyway. A data sheet will state in it a "line drawn in the sand", i.e. "25 mA", because that's what inexperienced engineers want, so they can stay their side of the line and not be blamed for anything (defensive engineering). Or that "25 mA" is a value of current they happened to had tested it at, and they don't know (or publish) what happens with other currents.
What is not realised with "legitimate current", is that if you as an engineer 'covered yourself' by setting each IC output driving a load for 24.99 mA, but there are 16 outputs, you'd have an extra 0.4 A supply current! There is a thing called 'maximum package power dissipation', and you've probably exceeded it by this extra power.