system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do automated/self-driving cars work?

How do they stay in the correct lane when driving?  How do they maneuver around obstacles?  How do they recognize stop lights?

There is a lot of judgment involved in driving.  How do the cars make these decisions?
gpt
The same way a human does.

Using sensors the cars can use various algorithms to determine where relevant road markings are, read signs, or otherwise get all the information put out there for human drivers. It uses this data to inform its decisions on how to move the car. It moves the car using various mechanisms to interact with the car's mechanics in much the same way as a human driver pushes the pedals, turns the wheel, etc.

When the technology gets a bit better (if it's not already true) an automated car would be quite a bit safer than a human driver. A human is decent at guessing whether, say, a swerve is necessary to avoid a collision, but a computer that understands Newtonian physics and has an array of sensor data about the car's velocity and the position of some other car or obstacle can work out with much greater certainty what the least dangerous corrective action is that will prevent an accident.