LiDAR stands for "light detection and ranging." The sensor sends out invisible pulses of light and measures how long they take to return after hitting nearby surfaces. Those measurements give your iPhone information about the distance and shape of objects in front of it.
A useful way to think about it is that the cameras show the iPhone what a scene looks like, while LiDAR adds information about how far away items are. ARKit, Apple's augmented reality (AR) framework, can use those readings to create a rough 3D mesh of the physical environment. This helps compatible augmented reality apps understand the position of floors, walls and other surfaces.
And apps are able to put that information to practical use. Apple's RoomPlan framework, for example, combines camera and LiDAR readings to identify walls, windows, doors, furniture and other room features while creating a 3D model of an interior space.
LiDAR can assist the camera as well. On supported Pro models, this sensor is used for features including Night mode portraits and faster autofocus in low light.