Simple explanation of photon internet connectivity required

New user. When running the example programs to flash a led over the internet, the command appear to be sent to the particle cloud which I assume then must relay the command to the photon.
I’m assuming the particle cloud holds the current ip address of my photon and acts like an exchange when it’s logged in.
Is that correct?
What happens if the particle cloud goes down or disappears?
Is there a method that sends commands directly to the photon with no use of the particle cloud?

AFAIK the cloud never actually pushes data to the Particles, but rather the devices poll the cloud.
For that reason the cloud doesn’t need to hold the devices IP and when a device disappears and reappears with a different IP, this would not matter.

For sending commands to the device without cloud, you can use non-encrypted TCP/UDP.
If you want encryption and run independent of Particle’s public cloud, you could use their local cloud server.
And in some future system release there might even be the option to use the Photons on WiFi-AP functionality.