Telephone numbers were thought out in a precise manner to help keep things organized, and with the future in mind. Dialing was very simple when phones first appeared in homes, of course, but a more detailed plan was needed when it appeared phones would be common and that they were here to stay. The NANP, or the North American Numbering Plan, was put in place to run the system from then on into the future.
Though you may think of this as something that runs the US phone system, it is actually used in the US territories as well. Also, it services places like Canada, the Caribbean, and Bermuda. This system was first developed in 1947, but was not totally in place and in use until 1951. Though it is used in the areas above, it was only for Canada and the United States at the time of it's inception.
The system was put in place so direct calling could be done between larger areas. The first call made using this system went from New Jersey to California. The long distance operators were using it, but it was necessary that everyone could use it when making calls. Anyone calling within their own area code could just dial seven digits, at this time, but the plan greatly improved the ease of using phones for communications.
The plan for numbering the original 86 area codes may not seem to make a lot of sense, but it does in many ways. When it was implemented, everyone was using rotary phones. This meant that areas that had the most calls - as in cities like New York (212) - would be making the most of the new system. They were given a code with numbers that were easiest to dial on a rotary phone. Areas with less population - like central Pennsylvania (717) - were given higher numbers.
Today, more area codes are added to the NANP all of the time due to demand. The original formula was to have a zero or one as the middle number, again due to ease of dialing, but that has not been the case in recent years. The plan still works so the territories covered through the system still use it today. For more information on any number within this plan, try a reverse phone lookup for more information.