walljumping was originally a glitch in the sidescrolling mario games that made it into the main gameplay
you have to catch your foot perfectly along the edge of a tile so the game thought you were on the floor and could jump, you can do the same thing to jump off of bottomless pits