The mediastinum is the central compartment of the thoracic cavity, surrounded by loose connective tissue, and located between the lungs. It contains critical structures such as the heart, thymus, portions of the esophagus, trachea, and major blood vessels.