A depth map is an image where the brightness of each pixel encodes distance instead of colour. White is closest to the camera, black is furthest away, and everything between is a gradient. That is the entire definition.
What makes them useful is that a depth map turns a flat picture into something with a third axis you can compute against.
Where depth data comes from
Historically, from measurement. Stereo camera pairs compare two viewpoints and calculate distance by disparity, the same way your eyes do. Lidar and time-of-flight sensors fire light at the scene and time the return. Both give you genuine measurements, and both need hardware you probably do not own.
The newer approach is monocular depth estimation: a neural network looks at a single ordinary image and predicts the depth map. No special camera, no second viewpoint. Models like Depth Anything V2 do this well enough that the output is usable for creative work, and small enough to run in a browser tab.
The distinction matters: measured depth is data, predicted depth is inference. Excellent inference, but inference.
What the gradient lets you do
Parallax. Separate the frame into near and far layers and move them at different speeds, and a still photograph acquires a camera move. This is the effect behind most 'photo comes alive' animations.
Depth of field. Real bokeh depends on distance, so blurring by depth value produces focus falloff that behaves correctly around edges, rather than the flat cut-out look of a masked blur.
Relighting and compositing. Knowing which surfaces are near tells you how light should fall across them and lets you place a new element at a believable distance behind existing objects.
Control for generative models. Many AI video and image models accept a depth map as a conditioning input, letting you keep a scene's geometry while replacing its style, lighting, or subject entirely. This has quietly become the biggest use.
Reading a depth map critically
Look at edges. Good depth estimation keeps a clean boundary between a subject and its background; weak estimation smears them together, and any parallax you build will drag background pixels along with the subject.
Look at flat regions. A blank wall or clear sky has no features to infer depth from, so models often fill them with a plausible gradient rather than a correct one. Usually harmless, occasionally very visible once things start moving.
Look at reflective and transparent surfaces. Glass, water, and mirrors defeat monocular estimation regularly, because what the model sees is the reflection, and it assigns depth accordingly.
When it is the wrong tool
Anything where the number matters — measurement, robotics, obstacle avoidance, anything safety-related — needs measured depth, not predicted depth. Monocular estimation is a creative instrument. Used as an artistic layer it is excellent; used as a ruler it is a hazard.