Landing a plane is fairly trivial considering that autopilot simply guides the aircraft down a radio beam, cuts throttle and raises its nose a bit when on-board radio altimeter crosses below 50 feet. First fully automated landing in revenue service predates the first microprocessor, which should give an idea of the tech used.
The difficult part is decision-making in non-standard situations like Sully landing on the Hudson with his A320.
With a recent software update, Tesla cars now perform evasive maneuvers when necessary even when autopilot is turned off.
There is a growing body of videos from dashcams (a feature enabled by another software update) on youtube showing Teslas avoiding collisions that would have been caused by other drivers being negligent.
But the simple autopilots (think an old Cessna) don't even try to avoid the ground for you. If you set it and forget it, you may find yourself dead on a mountainside.