Senpai (先輩) and kōhai (後輩) are an essential element of Japanese seniority-based status relationships, similar to the way that family and other relationships are decided based on age, with even twins being divided into elder and younger sibling. Senpai is roughly equivalent to the western concept of "mentor", while kōhai is roughly equivalent to "protege". Or simply an "elder" vs. someone younger in the family/company/organization—the terms are used more widely than a true mentor/protege in the West. There is usually no average separation in age between senpai and his/her kōhai.
A lowerclass student will often refer to upperclass students as "senpai", and alums will often refer to alums from earlier classes as "senpai". Particularly if fate brings them together later on, such as joining the same company, serving on a board together, or simply being in a club or parent's organization at the same time.
On rare occasions, a younger person may also be considered the senpai of an elder person if circumstances dictate—such as if the elder entered an organization or company at a later time than the younger did. This is not all that common, however.
In a Japanese school sports club, such as a baseball team, the kōhai are usually expected to perform various menial tasks for the senpai including washing clothes and cleaning. The kōhai may not be allowed to play the sport at all or have only limited opportunities to do so until they become senpai.
More than simple seniority, senpai implies a relationship with reciprocal obligations, somewhat similar to a mentoring relationship. A kōhai is expected to respect and obey their senpai, and the senpai in turn must guide, protect, and teach their kōhai as best they can. Senpai/kōhai relationships generally last for as long as the two people concerned stay in contact, even if the original context in which the senpai was senior is no longer relevant.
These terms appear frequently in anime and manga. Romantic crushes on one's senior are a popular theme in shōjo and romantic stories. In translated anime and manga, senpai/kōhai are more commonly retained in fansubs and scanlations, as official translations tend to use familiar English terms such as "upperclassman".
In Japanese martial arts, the term senpai generally refers to the highest ranked student in a club who is not yet a black belt. They are expected to assist the sensei with younger or less experienced students.