It’s the radar altimeter. It’s a simple but very important device that looks down and measures the distance from the antenna to the ground or whatever obstacle happens to be below it. it doesn’t need to know anything about obstacles in the area, it just measures what it sees. The display from the radar altimeter (radalt) is typically displayed on the flight instruments below 2500’. The callouts themselves are an option for the EGPWS, Enhanced Ground Proximity Warning System, but they just work off the radalt. It’s not unusual to get a “ONE THOUSAND” call going over a hill on approach, then another “ONE THOUSAND” call when you are again at 1,000’ over flatter ground. It is normally setup for calls every ten feet from fifty to the ground, other calls are more variable and just depend on which ones the company wants to include.
GPS altitude is available in the cockpit but not used for anything obvious that I’m aware of. You are correct that GPS altitude is not accurate or responsive enough for landing callouts.
The EGPWS does have obstacles and terrain in its database, but this is not used for the advisory callouts, it is used for ground collision warnings.
As for GPS approaches, GPS just by itself is not as good as an ILS approach, but there are supplementary systems that make it pretty good.
The problem with GPS is that it may be accurate to a few feet on one day, or fifty days, but on another day it might not be, and there’s no way to know, just using pure GPS, whether you’ve got a good day or a bad day. So GPS approaches have to be designed with the bad days in mind. A bad day is not one where you can’t get enough satellites, or some satellites are faulty, the GPS receiver can give warnings about that. The bad days are where everything is working perfectly normally but the errors all happen to cumulate in one direction and so instead of being a few feet from your expected position, you’re actually 100 feet from it.
To combat the above issues, there are augmentation systems available which basically work out the local GPS position error and then broadcast it to all GPS receivers in range so they can compensate their computed position. An example would be a ground station that knows its own position exactly, and knows what GPS thinks its position is in real time, and can then broadcast that error value.
The advantage of an ILS is that it is physically located at the end of the runway and projects a physical radio beam out along the approach path. It is very precise horizontally and vertically and gets more precise the closer you get to the runway. There are still traps with an ILS but an ILS will never put you 100’ off to the side of the runway.