A Comprehensive Study of Cavities on the Sun: Structure, Formation, and Evolution