ArduinoCloud.update() how does it work?

Hi Folks,

New to Arduino & IoT cloud. But, can't find documentation on ArduinoCloud.update(). I think I got it working. I have two switches in the dashboard and I when I turned one on from the dashboard (i.e. Red LED switch), I turned the other switch (yellow LED switch) off in the sketch. It took me a while to figure out how to have the status I changed in the sketch sync back (update) back to the dashboard switch (so it indicated "off'"). I used the ArduinoCloud.update() procedure after I set the yellow switch status to False in the sketch. I works, but I don't really understand how/why. Can anyone help? I've pasted a sample of the working could below: Thanks for the help... Scott

void onLEDPin8RedChange()  {
  // Add your code here to act upon LEDPin8Red change
  Serial.print("RedLED Pin 8 Status: ");
  Serial.println(lED_Pin_8_Red);

  if (lED_Pin_8_Red) {

    digitalWrite(myLED7, LOW);
    lED_Pin_7_Yellow = false;
    ArduinoCloud.update(); 
    digitalWrite(myLED8, HIGH);

  } else {

    digitalWrite(myLED8, LOW);