The use of "John Doe" as a name for anonymous or unidentified people dates to 13th century England, when the name was first used in legal documents to protect the identity of witnesses. The concept of a false alias in legal documents is actually quite old; the Romans, for example, had their own version of "John Doe" for use in legal proceedings. This name was probably originally chosen because it is unremarkable; every nation in the world has its own regional variation on "John Doe," ranging from Mou Mou in Chinese to Fulan ibn Fulan al-Fulani in Arabic.
There are a number of reasons to use aliases. In the first case, "John Doe" is used for someone who cannot be identified, such as a murder victim or a witness to a crime who has not come forward. Generally, identifying information about the person will be released in the hopes that someone can identify him, allowing law enforcement to drop the "John Doe" and use the person's real name. The use of an undistinguished name allows people to focus on the actual identifying features of the victim, whereas an alias like "Jacob McNamara" would be confusing and potentially distracting.
This alias is also used in legal proceedings to protect someone who does not want to be identified. Such aliases are often used in criminal trials where someone is concerned about reprisals, for example, and members of juries are sometimes referred to as John Does in discussions about criminal trials so that they cannot be identified and pressured. This name is also used when someone's name is not relevant to a case. Newspapers also use John Doe to describe people who cannot be legally identified, such as rape victims.
People also use John Doe as a placeholder name, to refer to someone who does not actually exist. For example, a lawyer might cite a hypothetical situation involving a John Doe to explain why his or her case should be upheld in court or to strengthen an argument in the eyes of a jury. Someone might also say that a film might appeal to a John Doe, meaning that it would satisfy the tastes of an ordinary or average person.
John's counterpart is Jane, an unidentified female or young woman. Baby Doe is an infant or very young unidentified person, and the names Roe, Smith, Jones, and Noakes are sometimes used in conjunction with names like John, Joe, and Jane to mix things up a bit. Some people also use the alias "John Citizen" or "Joe Blow" to describe an average or ordinary individual; political rhetoric often features a mythical John Citizen, for example.