CloudFormation allows users to create and manage AWS infrastructure through templates that describe resources using JSON. The template defines parameters, mappings, resources, and outputs. Resources like EC2 instances are created and deleted by CloudFormation. References and intrinsic functions allow resources to reference attributes of other resources. Parameters allow customization, and mappings enable conditional parameter values. Outputs return information to the user. CloudFormation provides advantages like reuse, transparency, flexibility, customization, and integration without extra charges.