Correct me if I am wrong, but what I think you are really trying to ask is: “how does the circuit magically know what components are down stream in the circuit?” Information can only travel as fast as light, so there must be some amount of time where the electrons leaving the voltage source are unaware of the resistor on the other side of the diode.
The short answer is the electrons don’t know. Research transmission lines to understand this.
The long answer is the electrons don’t know what is down stream, and they begin to travel down the wire as if it is a short circuit to ground. The wire is conducting a very high current at this point. We model this as a capacitance in parallel with the component (resistor, diode, the wire itself).
This current continues until the electrons reach something that impedes their flow, like a diode, at which point some of the current is reflected due to the impedance of the diode literally impeding the flow of electrons. The electrons leaving the voltage source are still unaware of what is downstream even though some previous electrons already reached the diode and reflected back. This leads to a buildup of electrons at the diode and creates a rise in voltage, even higher than the voltage source, and sends a current into the voltage source, which has an impedance and causes another reflection which travels back down the wire. This “ringing” eventually settles to a steady current flow into the diode. This is modeled as an inductor in series with the component (resistor, diode, the wire itself).
Keep in mind that all of this occurs very quickly in a circuit, on the order of picosecconds or less, depending on the length of the circuit. These effects are mostly ignored unless you’re dealing with very fast and/or sensitive electronics, or long traces/wires/cables. With long cables, you can actually see the reflections using an oscilloscope because the reflections occur on the order of microseconds.
This happens for every component in the circuit and the back flow of electrons (the ringing) settling to steady-state is really how the electrons coming out of the voltage source know how to behave (i.e. how much current should be flowing).
This is just a basic explanation. To really understand transmission lines, there has got to be a video or opencourseware lesson that adequately explains it.