A namesake is a person, geographic location, building or other entity that has the same name as another or that is named after another entity that first had the name.
The opposing term, referring to the original entity after which something else was named, is called an eponym.
The word is first attested around 1635, and probably comes from the phrase "for one's name's sake", which originates in English Bible translations as a rendering of a Hebrew idiom meaning "to protect one's reputation" or possibly "vouched for by one's reputation." A familiar example which schoolchildren used to learn by heart is in Psalm 23:3, "he leadeth me in the paths of righteousness for his name's sake" (King James Bible, 1604), or in the metrical version "e’en for his own name’s sake" (Rous 1641, Scottish Psalter 1650, see The Lord's My Shepherd).
When namesake refers to something or someone who is named after something or someone else, the second recipient of a name is usually said to be the namesake of the first. This usage usually refers to humans named after other humans, but current usage also allows things to be or have namesakes. Sometimes the first recipient can also be called the namesake; however, the correct and unambiguous term would be the eponym.
Naming a child after a relative, friend, or well-known person is a common practice in the English-speaking world. Continued practise of naming a child after the parent or grandparent may result in several relatives (e.g. cousins) being namesakes of each other despite not having been named after each other.
Among Ashkenazi Jews, it is customary to name a child after a dead relative, such as the child's grandparent, but never after a living person. Sephardic Jews traditionally are encouraged to name their children after relatives, living or dead. Greek families traditionally name a child after its paternal grandparents and the second child of the same sex is named after its maternal grandparents.
When a son is named after his father, "Jr."/"II", "III'", or another name suffix may be added to the name of the son (and sometimes "Sr." or a prior number to the father's name), in order to distinguish between individuals, especially if both father and son become famous, as in the case of poet Oliver Wendell Holmes Sr. and his son, Oliver Wendell Holmes Jr., an Associate Justice of the United States Supreme Court.
Sometimes the "Jr." or "Sr." suffix is applied even when the child's legal name differs from that of the parent. One example is that of the singer Hiram King Williams, known professionally as Hank Williams, and his son Randall Hank Williams, known professionally as Hank Williams Jr. Daughters being named after their mothers using similar suffixes is less common. One example is thoroughbred jockey Rosemary Homeister Jr. whose mother was also a jockey before turning to train. A more archaic method of distinguishing father from son was to follow the name with the Elder or the Younger, respectively, for example William Pitt the Elder and William Pitt the Younger.
Buildings, such as the Trump Tower, and companies, like the Ford Motor Company, are often named after their founders or owners. Biologic species and celestial bodies are frequently named after their discoverers. Alternatively, their discoverers may name them in honor of others. Occasionally, material goods, such as toys or garments, may be named after people closely associated with them in the public mind. The teddy bear, for example, was named after President Theodore Roosevelt, because of a popular story in which the then-President objected to cruel treatment of a bear by hunters.
The fedora hat may be considered the "namesake" of a fictional character, Princess Fédora Romanoff, from an 1887 play, Fédora, by Victorien Sardou. In her portrayal of that character, Sarah Bernhardt wore a soft felt hat with a center crease, which became known popularly as a "fedora".
Several United States military aircraft have served as the namesake of previous aircraft. The Fairchild Republic A-10 Thunderbolt II attack aircraft was named after the WWII-era Republic P-47 Thunderbolt fighter-bomber.  The McDonnell Douglas F-4 Phantom II is the namesake of the McDonnell FH Phantom. Uniquely, the LTV A-7 Corsair II serves as the namesake of both the Vought F4U Corsair and the earlier Vought O2U Corsair, the former also being the namesake of the latter. The newest fighter of the United States, the Lockheed Martin F-35 Lightning II is the namesake of the United States Army Air Forces twin-engined Lockheed P-38 Lightning.