Apple's internal codenames have always been a part of the myth of Apple. What started as a nickname for the project back in the 1980s with the Apple //+ has become an essential part of Apple's security measures. Apple always considered leaking information of upcoming products (especially specs) to be bad for selling the products from the current line. By giving their products codenames, Apple minimized the possible damage a leak could make. Even if details were leaked into public, the codenames prevented Mac users connecting the details to a product (name). Often the products even bore multiple codenames, for internal use and for external use (e.g. when talking to developers).
The Mac community has always been keen on finding out the codenames of the lastest Apple products. But not only on rumor websites the codenames were regularly used, often the codenames became the nicknames of the product after its release.
In the early days of Apple, the codenames were all female names, mostly the names of the daughters of the engineers who were working on the product. Later, different types of apples were used, but when the teams ran out of apple types, they had to find new names. Hence after a couple of years the codenames were items from popular culture or products the engineers liked (such as beer ;-)). The team who worked on the Apple Developer CDs was especially creative finding codenames. They picked names of famous movies and replaced words from the titles with computer related vocabulary. With the developement of the first iMac in 1997, Apple introduced a new naming sceme for intenal codenames. Instead of a codename, Apple started referring to their new products with project numbers. These numbers were supposed to minimize the possiblity of a leak even further, as these numbers didn't allow any assosiation with the upcoming product (although it was said that the 'C' in the original iMac's project number (C1) was standing for "consumer", a direct hit to the characteristics of the iMac). To read more about Apple's history click here