Everyone's stating fancy ways to edgeguard, but I think the question is what exactly makes you edgeguard.
Basically, you have to face the ledge, and be falling past it. As you drop past it, you grab the ledge. You then just hang there as the opponent tries to recover (don't do anything). When the opponent recovers to where he would normally grab the ledge, he'll fall right past it, resulting in death.
During the first few moments of you grabbing the ledge, you get invincibility frames, where you can't get hit by anything. This is where the timing comes into play. If an opponent with a recovering attack (e.g. Mario's up-B) recovers near the ledge, you will get hit if you don't have the invincibility frames. To prevent this, you grab the ledge a bit before he recovers, and you'll get invincibility frames, resulting in him falling to his death.
What everyone posted are some advanced edgeguard techniques, which make edgeguarding that much more effective.