M5 means "stop the spindle's rotation".
A spindle is a controlled motor that turns a tool ( endmill ) at a given speed to allow it to remove material from the workpiece.
M5's evil twin is the M3 command which is used to start the spindle and specify it's rotation speed
The command is used as such :
Which means : stop the spindle's rotation.
The spindle functionality of Smoothie is configured via the Spindle module
These resources are used as references for Gcode :