Facts are variables that provide information about managed nodes, such as operating system, IP address, and hostname, and are gathered using the setup module. Facts allow playbooks to dynamically handle different operating systems or configurations by basing logic on facts rather than static variables. Fact data can be accessed in templates and used to conditionally run tasks based on facts about remote systems.