
To the best of my knowledge, when the country standard was being set up (in conjunction with Canada, I believe, since we can dial them like we would New York or LA), 3 digit area codes were used to denote geographical locations, then the 3 digit prefix denoted where in the area code you were (usually a town had more than one, unless it was tiny), and the last 4 digits were unique to the line. Some towns were small enough that you only had to dial the last 4 digits to connect to a neighbor or local business. At the time calling an area code different from yours was always long distance, but calling the same area code as you was not always local. It was a 1 followed by area code, prefix, unique code for long distance calls.
They had a standard way of setting up area codes, so that they always had a 0 or 1 in the middle, such as 612, 704, 314, etc. 800 was reserved for toll-free, free-phone, etc. type calls that the receiver of the call would pay the connection and long distance fees, not the caller. Generally used for businesses who tried to pretend they cared about customers, but mostly used for TV scams and "As Seen on TV" crap. As the US grew, and 800 numbers became popular, they tried to keep the same theme, so you had 866, 877, 888... collectively known as "800" numbers. I believe that people overseas cannot actually call these numbers, which can present a problem when you are calling a US corporation or call center while an American overseas. The area code 900 corresponds to premium rate, or per-minute lines, like the phone sex lines and Miss Cleo, the TV psychic... not exactly for the sound of mind. Somewhere there is an area code for the US Gov't, though since I've never called them, except for the 800 numbers, I have no clue what it is.
As time went on, and 2nd lines (for home offices, teenages (some parents really spoiled their kids) and more recently, dedicated lines for modems and such) and cell phones rose in popularity, suddenly the carefully crafted rules of area codes didn't work so well. The area code, prefix, and unique portion were good enough to cover a lot of people and companies, if they kept one line each. But they ran out, and the x0x and x1x standard suddenly wasn't viable. So now, you have ones like 763, 952, 860, etc. I believe there are still rules that it cannot repeat, unless its an 800 number, so no 111, 222, 333, etc, and there the whole x11 block is reserved. 911 is the national standard for emergency, which means it cannot be an area code, 411 is information, usually charged by connection or minute, and there are other x11 numbers that are either federal or state control. 311 is often a traffic update number, I've noticed.
As to the 555 used in Hollywood, while the area code would not be legit, it also is not legit for the 3 digit prefix anywhere. I know a lot of the same area code rules apply to prefixes, because until the last 10 years, most people only had to dial an area code when calling long distance. Otherwise, the 7-digit number was just fine, which meant the x11 was out of the question. I think the repeating numbers prefix is out, so you wouldn't find 555 or 111... though I think I've seen a 222.
Relevant to the above discussions, an additional problem that Americans, especially the Californian variety, would not have realized is that here in the US, you just dial the 10 digit number for anyone you are calling if you are calling from a mobile/cell phone. No need a 1, no need for the older 7 digit code. Just dial xxx-867-5309 (damn you Tommy Two Tone!) and you are golden. I'm sure it makes the directory logic and outgoing calling logic that much easier... if you neglect the other 5.8 billion people in the world. Again, American's are good at that, yes, but California thinks of itself as the US as a whole, so you have them neglecting pretty much the whole world, minus 35 million, give or take.
Anyway, that was the tour of the American (and presumably Canadian) phone system. It was set up by AT&T back in the day when they controlled the entire telecom world in America, with the generous backing of the federal government. There are points here gleaned from years of living through the change from a 7 digit world to a 10 digit world. I'm sure Whackypedia may disagree on some points, or have varying explanations, especially around the 555 bit. I hope you were all bored silly by it, but I'm just sitting here waiting for something finish up before I can head off to bed.
Mine's the ratty terry cloth robe with cherry burns.