Ant is a Java-based build tool that uses XML files to automate software build processes. An Ant build file defines projects, properties, targets, and tasks. Projects contain targets, which are composed of tasks. Common tasks include compiling Java code, generating documentation, and cleaning workspaces. The example build file shows how to set up directories, compile code, generate javadocs, and clean up using tasks within different targets. Ant can be run from the command line or within Eclipse to execute targets and automate build processes.