GAN has two parts: a generator and a discriminator. In the case of numerical recognition, the generator takes in random numbers and returns an image. Then the images, either generated or given, are fed to the discriminator where the network makes a probabilistic decision on whether the images are authentic. The discriminator and generators are trained hand-in-hand: discriminator makes better decision while the generator learns by making more realistic images. Compared to VAEs, the images tend to be less blurry.
See Skymind.ai’s wiki on GAN