Button mashing often refers to the act of quickly pressing various controller inputs in rapid succession. While carrying some negative connotations in fighting games, Smash included, button mashing does have some specific uses. For example, rapidly pressing buttons allows characters to escape situations like being stunned, grabbed, or frozen more quickly. It is also known to be used to get out of Wobbling and Ice Climbers' chain grabs.
Button mashing can also refer to repeatedly pushing the same input (or spamming), such as mashing the special button when firing Fox's Blaster. Spamming can prolong many attacks, and may also be used to increase the frequency, range, duration, etc., of others. When precise timing is not required, mashing is often the fastest and most reliable way to go. Less advanced players may choose to mash with techniques like dodging in order to increase their chances of success. The buffer system in Brawl makes this kind of button-mashing more useful as it allows automatic frame perfection.
To escape out of grabs more quickly, these buttons can be mashed: A, B, X, Y, L, R, Z. By alternating these, it is possible to decrease the remaining grab time counter by six every frame, for example by pressing A on frame 1, B on frame 2, A on frame 3 again and so on. Additionally, every cardinal direction on the control stick further decreases remaining grab time by six. Thus, it is possible to decrease the counter by twelve on every frame, for example by alternating between left on the control stick plus A and right on the control stick and B every frame.
Smash 4 button mashing works slightly differently compared to previous games. First, the buttons cannot be used in conjunction with the control stick to decrease the amount of time spent immobilized, as using both of them together only counts as one collective input, unlike in Melee, where a directional input and a button input could be combined.
Additionally, alternating buttons such as X and Y when both are mapped to Jump by default would be counter-productive, since the inputs are very likely to overlap with one another; thus, the best method of button mashing is to alternate buttons mapped to different actions. One can also mash just one button for the same effect, given enough hand speed.
As for the control stick, simply rotating it will assist better in breaking free than alternating two directions at once, making it easier to mash out using only the control stick than in previous games. While button inputs decrease the timer more than control stick inputs, using the latter puts characters in a better position while they are stuck in the air (such as escaping the buried state, after Yoshi's Egg Lay and Wario's Chomp, or grab releases off the ledge), as it prevents them from blindly attacking, dodging, or jumping during the attempt to mash out.