A substitute is a block that your Pokemon sets up that costs 1/4 of your max HP to create. It can take "dummy hits" for you, without you taking extra damage.
The HP you give up is invested into the strength of the Substitute. So if you had to give up 54 HP (That would make 216 max HP) to make a substitute, then the substitute will have 54 HP as well.
Basically, if your substitute fades, it's the equivalent of a Pokemon being KO'd, meaning it has lost all of its HP, and cannot stay on the field longer, so you'll need to make another one to keep the dummy hits coming.
So if the Substitute doesn't fade, then it basically means that the attacker flat-out sucks, and can't even take out 1/4 of your HP in one attack.
A few facts about Substitute:
~Substitute blocks all status moves (Toxic, Thunder Wave, etc.) and stat-reducing moves (Growl, Tail Whip, etc.)
~Substitutes can be passed to another teammate with Baton Pass (This is why Baton Pass-hacked Blissey are so common, for their 150+ HP Subs).
~You can use multi-hit moves, like Pin Missle, Doubleslap, Fury Swipes, etc, to hit through a Substitute, and continue attacking (Because of Cloyster's ability, Chain Link, it makes a perfect Sub-Breaker).
This is about as in-depth as you get with Substitute. xD