In a GAN, the generator network aims to create data that is indistinguishable from real data, while the discriminator network's goal is to differentiate between genuine and fake data. The two networks are trained simultaneously in a zero-sum game, where the generator improves its data generation capabilities, and the discriminator becomes better at spotting fakes. Over time, this adversarial process leads to the generator producing highly realistic outputs.