Apache Pig is a platform for analyzing large datasets that operates on top of Hadoop. It provides a high-level language called Pig Latin that allows users to express data analysis programs, which Pig then compiles into MapReduce jobs for execution. The architecture of Pig consists of a Pig Latin interpreter and runtime environment. Programs written in Pig Latin are compiled into a series of MapReduce jobs to perform tasks like join, filter, sort on large datasets without needing to write MapReduce code directly.