A metric tensor is a mathematical object that defines the distance between points in a given space, providing the means to measure angles, lengths, and volumes. It plays a crucial role in the formulation of general relativity, where it describes the curvature of spacetime caused by mass and energy.