It's character-dependent. A few examples:
can be edgeguarded by grabbing the ledge and Thundering in place at the right time. No matter how she angles her recovery, unless she has the attack custom she will get hit if you time it right. If she doesn't get hit because she made it to the body of the stage (the ledge itself is covered by Pikachu's body, so she can't make it there usually), and you do it correctly, you won't regrab the ledge, and you can QA to her position on the stage and up-smash or dash attack her for the KO.
is vulnerable to b-air when he's using Balloon Trip. The hitbox of b-air is so compressed that you can hit the balloons without hitting Villager's body and send him plummeting. You can't do this if he's too high above you, but you can nail him with a Thunder since he has to descend at some point. Catching him out of Loid Rocket is easy for Pikachu because if he lands on stage with it, Pikachu can QA to his location, or Thunder if Villager is above.
loses to jump f-air if he uses side-b (need to be below the lip of the stage to use this if he's aiming straight for the ledge). If he's going to use up-b, he'll either do it hugging the side of the stage or from some distance out. If he's hugging the side of the stage you want to d-air. If he's some distance out then you want to falling n-air. Up-air is his anti-edgeguarding tool, but you can d-air through it because of the way d-air extends Pikachu's hitboxes. N-air is a little harder to do this with, so just mixing up d-air and b-air (which can also beat his up-air due to the compression) should be good enough if you're uncertain of when to use n-air.
becomes stationary when he uses his up-b, so you can jump out literally on top of him, airdodge past any possible f-air or n-air, and Thunder in place. If you do it right, you should be on top of him or near him. The Thunder will collide with the burst of PKT2, but Pikachu won't take any damage, and Ness loses his stock. This takes guts to do, though, and also practice. Most of the time he'll just recover without up-b because of it, too, so you should try to catch him with your lingering b-air to eat airdodges and tear through f-air. Be careful Thundering Ness from way below him; if you make it obvious he can absorb it.
and so on.
The only characters that you can't edgeguard in some way are customs Palutena (too many mixups), customs Ike (well, you
can, it's just really hard), Jump Monado Shulk (super hard), Meta Knight (never worth it), and Sheik (seldom worth it). Some characters like Ganondorf get harder to edgeguard with customs, too, but it's still possible.