What is happening to the code in Bolt Cloud and data flow from the iot sensor?

Here is the situation:
I setup a python script to compute z-score for a light sensor connected at A0 pin in Digital Ocean droplet. The droplet reads from A0 and prints the Z-score and the value at A0 every 10 seconds.

At the same time, I chanced upon an older browser tab in my computer that had my previous project creating a graph of a temperature sensor that had been previously connected at A0 pin, but now no longer there. The graph was still plotting based on the value of A0 from the light sensor. A new data point was being added to the plot every 5 minutes.

Questions:

  1. Is there any code that gets deployed into the Bolt iot module? Or,
  2. Is the code in the Bolt iot module constant and the javascript code that we write on Bolt cloud specifies what pin values need to be read/ written?
  3. How does the bolt iot module know at what frequency data needs to be sent?
    3a… How does the module know where to send the data?
    3b… How does the bolt cloud communicate with the bolt iot module?
    3c… How does the api call from Digital Ocean droplet get routed to the bolt iot module?

Hello there,
I am new to all this and I am keen to have a thorough understanding of the process.
Thought I might as well have a go at answering your questions and get my thoughts cleared out(Take my answers with a pinch of salt, it may not be entirely correct):

I believe no code is being deployed to the bolt iot module, it is just receiving instructions from the bolt cloud.
3.a. The IP address of the bolt cloud server is hardcoded on the bolt iot device.
3.b. Bolt cloud and Bolt device communicate using the MQTT internet protocol.
3.c. The api acts as a messenger between the Digital Ocean droplet and the Bolt cloud which then routes the desired instruction to the bolt device.

This is my understanding of the process that is taking place.
Kindly request anyone to correct me if I am wrong.