RE: Caller ID name, or CNAM, expanding on sdb's comments:
In basic terms (leaving out the technology-used details), the original caller ID system simply displayed the calling party's telephone number, derived from the phone switches setting up the call. As long as the calling party's number is permitted to be displayed (the caller hasn't enabled caller ID blocking, or the caller isn't using some sort of scheme to avoid displaying the caller ID or otherwise alter/spoof it), AND the called party subscribes to caller ID service on their end, with their telco, then the sent number is displayed.
Caller ID NAME was added later. Since the phone network didn't send any sort of name data along with the call, the called party's telco used the calling party's number to perform a database lookup on their end, then added a string to the caller ID data sent to the called party. This all depends on 1) the calling party's telco "feeding" their subscribers' names and matching numbers to the various third-party database maintainers, and 2) the called party's telco paying for the use of those databases, which obviously cost money to maintain.
There are many problems with the system now: before the telco monopoly was deregulated, the "Baby Bell" carriers and the General Telephone and few other incumbent carriers maintained their own DBs. Now, there are various independent companies also selling the databases, and the accuracy and currency of their DBs varies. When they don't have a matching record, they, or the telco doing the lookup, may substitute some other string, such as the city and/or state of the caller, which is easily obtained from the area code and prefix. Or, they may display "Wireless Caller", for mobile numbers, since many cell phone carriers don't feed the DBs. (Sprint and T-Mobile do; I dunno about the others).
Finally, as has been pointed out, some non-telco alternatives exist: VoIP ITSP providers like Callcentric may offer a way for their subscribers to load in their own name/number data, and use that as an override for any telco-provided data. Telephone hardware, like most modern cordless or "feature" telephones, can also hold an address book in the phone itself, so what you end up seeing when the phone rings can come from a variety of sources.