A model does not arrive knowing anything. Before it can generate, it is trained on a very large collection of examples: books, articles, captioned photographs, video clips, and so on. During training the model is shown these examples again and again and its internal settings are adjusted until it becomes good at anticipating what tends to appear together.
What gets stored is not the examples themselves. It is the regularities inside them. In text, that means which words tend to follow which others, and how sentences and paragraphs are usually shaped. In images, it means how edges, textures, colors, and object shapes tend to be arranged. In video, it adds how things usually move and how a scene tends to change from one moment to the next.
This is why training is often described as compression. A library's worth of material is squeezed into a compact set of internal settings that capture the recurring structure and discard the incidental detail. The model keeps the pattern and lets go of the specific instance. When it later generates, it draws on those captured regularities rather than looking anything up.