However Grbl (which is the code running on your Arduino controller) does know what you have told it about your machine and what the gcode is directing it to do.
UGS knows nothing about the machine or the part you are making, it is simply sending the gcode to the controller.