ZooKeeper is a distributed coordination service that manages large sets of hosts. It was originally built at Yahoo! to easily and robustly access applications, and was later adopted as a standard by distributed frameworks like Hadoop and HBase. ZooKeeper provides services like naming, configuration management, leader election, locking and synchronization to help distributed applications coordinate and maintain shared data reliably. It uses techniques like mutual exclusion and serialization to ensure ordered messaging and consistency even if some nodes fail.