Spacetime is a four-dimensional continuum that combines the three dimensions of space with the dimension of time. In general relativity, massive objects such as stars and planets warp spacetime, creating what we perceive as gravity. This curvature affects the motion of objects and the path of light, leading to phenomena like gravitational lensing.