A GAN consists of two neural networks, a generator and a discriminator, which compete against each other. The generator creates new images, while the discriminator evaluates their quality and authenticity. This process iteratively improves the generator's output, leading to increasingly realistic and creative images.