Grinding is when Mario's position is constantly switching between the air and the ground. While in this state, he can Ground Pound, double jump, dive, and more. In most cases, this will just a result a normal running speed. In the case of Hyperspeed Grinding, you gain more than walking speed.
Uses of grinding
Grinding has several uses. For example, a double jump can be performed immediately out of a grind, without single jumping or kicking first. Since double jumps go higher, this can save time in TASes such as 1 Key and save A presses in the A Button Challenge, such as in Bowser in the Sky at the beginning, before the 207 DR technique was discovered. Grinding to gain speed allows Mario to dive more quickly, helping several times in Tick Tock Clock.
Remote floor use
Since Mario can be on a floor but in the air while grinding, the game can look at the floor far beneath him instead of his current floor. Mario can actually experience the properties of that floor, such as sliding, quicksand death, extinguishing a burn, and even lava boosting, although remote lava boosting is not performed by grinding.
Divegrinding is a form of grinding in which Mario constantly dives against the edge of a platform, usually a slope. This is the fastest way to climb slopes that would cause Mario to slide. It is executed by straining off the edge of the slope, then diving and straining back on, repeated many times.