The image is not produced in one pass. The model applies a long sequence of small steps, commonly a few dozen, and each step adjusts the pixel values a little. Early steps establish large-scale structure: where the main masses of color sit, roughly where the horizon or the subject is. Later steps sharpen edges, add texture, and settle fine detail.
At every step the prompt is consulted. The model asks, in effect, which small change would move this grid closer to something that matches the description. Because the prompt is applied repeatedly rather than once, its influence accumulates. A vague prompt leaves many directions open, so the model falls back on whatever is most typical in its training data. A specific prompt closes off more of those directions and steers the accumulated corrections toward the described result.
The step-by-step structure explains a behavior that otherwise looks strange: the image changes shape as it develops. A blob that will become a face may first look like a stone, then a rough head, then a face. The model is not committed to an early interpretation; it revises as the picture becomes clearer. This is also why the number of steps matters. Too few and the image stays coarse or half-formed; more steps generally allow finer detail, though past a point the returns diminish and the image stops changing much.