From SmashWiki, the Super Smash Bros. wiki
Wall grappling is a technique in Melee that can be used by Link, Young Link, and Samus that allows the player to hook to a wall and climb up. Unlike a tether recovery in Brawl and SSB4, wall grapples can connect with any wall surface instead of only edges.
Wall grapples are executed by performing a grab air while facing the wall. If the grab air is executed by the R/L and A buttons, the character can also air dodge upwards to aid in their recovery. The distance from which a wall can be grabbed is limited; If the character is too close or too far away, the grab will not connect and the character will enter the helpless state.
Once the wall is grappled, pressing A or a jump button will cause the character to scale up the wall. While wall grappling will not refresh double jumps, players may still use their up special and other moves for recovery. Players do not have to immediately act when they have attached to a wall; however, if the player hangs for too long, the wall grapple will end, sending the character into a state of tumbling as well as taking away their second jump if it is not yet used. Similarly, being slightly too far away from the wall can cause players to immediately "fall off" after their character swings towards the stage, putting them into a state of tumbling as though they had held on for too long.