M02/M30 command

I know how to edit the postprocessor included commands. I want to understand what the current M02 command being included in the g-code is actually doing in CM or the CNC so I know how to change the post processor.