Lidar will give you XYZ (z = distance) on a single datapoint, cameras give you XY and you need to calculate the Z from multiple cameras.
Lidar is ugly and expensive, but requires way fewer cycles to calculate distances. And it works through fog and even some obstacles, nor does it care about glare or get "scared" of shadows.
If we had infinite compute in the car, cameras would be the obvious solution ...but we don't. You can get "Pretty good" with cameras, but still people find specific spots where the car is 100% sure a shadow under a bridge is a car or something stupid like that.