On a CNC machine, S is the ‘spindle speed’, usually measured in RPM. When you send a GCode feed move the S parameter sets the analog (PWM) output that feeds into a device that controls the spindle speed, or in our case, laser power.
The S parameter can be literally any number - Some GCode systems use 0 to 1 (with decimals, like 0.52), some use 0 to 100 (percent), some use actual RPM (500 to 5000), and GRBL often uses 0 to 255 because programmers are lazy and when you read an 8-bit image, the values are from 0 to 255, so naively they’ll just send the 8-bit number right from the image file. (That’s actually wrong for a couple of reasons). Newer GRBL uses 0 to 1000 by default.
The software generating the gcode needs to know what range to use for the S parameter, and the controller reading that gcode has to know what range to expect, which is why they need to be set to the same number.
If I tell you “set your speaker volume to 10” that could mean a few different things - If I think stereos go from 0 to 10, then I meant “set full volume”. If your stereo shows 0 to 100, then you’d interpret what I said as “set it at 10 percent of full volume” which is obviously not what I meant - that’s why both ends have to agree on what the numbers will be.