Z button

The Z button refers to the rectangular gray trigger located on the back of a Nintendo 64 controller, the long purple button at the top right corner of a GameCube controller, and the rectangular button on the back of the Nunchuk. The Z button matches the color of the Nunchuk shell.

Overview
The functionality of the Z button has changed throughout the series. In the original Super Smash Bros., the Z button is used to shield. In Super Smash Bros. Melee, shield functionality was moved to the L and R buttons, and the Z button now activates a grab. Holding the button past the grab will shield the character and pressing the button in Melee specifically can grab items in midair. If the character being played as has a tether grab, pressing Z while airborne will instead use their tethering object as an attack. In Melee, pressing Z while airborne as a character with a tether while there is an item nearby will grab the item instead of using the tether as an attack. While the GameCube controller functions identically in Super Smash Bros. Brawl, the Z button on the newly introduced Nunchuk activates shield. The functionality of both controllers are retained in, but only the GameCube controller is retained in Super Smash Bros. Ultimate. A Nintendo 64 controller was created for Nintendo Switch Online subscribers, albeit being an N64 controller in design only with the internal components of a Nintendo Switch Pro Controller.

In Brawl, For Wii U, and Ultimate, the Z button can all be customized Controls to perform other functions. While not directly related, Nintendo Switch hardware version 10.0.0 introduced the ability to map the functionality of any button to any other button from the console options menu, further diversifying how the Z button can be used in Ultimate.

In terms of Brawl's programming, the Z button on the GameCube controller is considered to be both a shield button and a standard attack button at the same time. This is known because nowhere in character movesets does the game check to see if a grab button has been pressed - it only checks for if a shield and an attack button have been pressed simultaneously. This explains why the Z button can execute both attack-based functions (natural combo continuations, smash charging) and shield-based functions (air dodging). It is currently unconfirmed if this is the case for the other games as well.

ZL and ZR button
Starting with the Wii Classic Controller, controllers developed by Nintendo split the Z button into two different buttons, the ZL button and ZR button. This was done to add more buttons and give developers more freedom to make the game they want. In Brawl and For Wii U, both buttons functioned identically to the Z button on the GameCube controller. For 3DS initially had the ZL and ZR button perform identically to the L and R button, respectively, due the the game releasing before the New Nintendo 3DS introduced these buttons to the system. However, version 1.0.5 swapped the functionality so now the ZL and ZR button perform identically to the R and L button, respectively. Ultimate changed their functionality by instead activating shield.