Terraform is an infrastructure as code tool that allows users to define and provision cloud infrastructure resources through configuration files. It has three main components - the Terraform executable, configuration files with the .tf extension that define infrastructure as code, and Terraform state files with the .tfstate extension that track the current and desired state of resources. Configuration files use variables, providers that connect to cloud platforms, and resources to define what infrastructure to provision. The Terraform executable is then used to plan changes, apply configurations to provision resources, and destroy resources.