From Pixels To Patterns: Unveiling The Deep Workings Of Generative AI