One common way machines create images starts, surprisingly, from random noise. A diffusion model is trained by taking real images, gradually adding noise until they are static, and learning to reverse each step. To generate a new image, it begins with pure noise and repeatedly removes a little, guided toward what was asked for.
Step by step a coherent picture emerges from the static. The approach produces varied, detailed results and can be steered by a text description, though it takes many steps and considerable computation, which is why generating an image is slower than it looks.