What are the main components of a GAN, and how do they work together to facilitate the learning process?