It learns by doing the opposite. Training adds noise to millions of photos and teaches the model to undo it. Once trained, it can start from pure noise and, nudged at each step by a description or a reference, settle on a new image. Most of today's image and video AI works this way.
What it doesn't know is your product. Left alone, a diffusion model draws a plausible jacket, not your jacket, and it will happily change a button or a print. That is why product work adds references, fine-tuning such as LoRA, careful direction and a person comparing the result with the real item.