Cocoapods is a library dependency manager for Xcode projects that allows importing third party libraries and managing their versions. It works by having users add a Podfile to their project specifying dependencies. Cocoapods then handles compiling dependencies as static libraries and generating an Xcode workspace with the library code incorporated. This avoids many issues of manual library installation like errors, unclear upgrade paths, and needing to check library code into version control.