Shogun
The title or rank of shogun (将軍), meaning "great general", is a contraction of Seii Taishogun (征夷大将軍), meaning "the great general who overcomes the savages".
Shoguns of Heian Period Japan
Originally, the shogun title was given to military commanders during the early Heian Period for the duration of military campaigns against the Emishi, ancestors of the Ainu, who resisted the governance of the imperial court based in Kyoto. The most famous of the Heian Period shoguns was Sakanoue no Tamuramaro (758-811) who conquered the Emishi of the present day Tohoku region of northern Honshu. Eventually the title shogun was abandoned in the later Heian after the Emishi had been defeated and driven to Hokkaido.
However, in the later Heian one more, however short-lived, shogun was appointed. Minamoto no Yoshinaka was given appointed shogun during the Genpei War only to be killed shortly thereafter by his distant cousin Minamoto no Yoshitsune, brother of Minamoto no Yoritomo.
Shoguns of Feudal Period Japan
After the defeat of the Taira clan in the Genpei War in 1185, Minamoto no Yoritomo seized power from the emperor and became the dictator and de facto ruler of Japan. He established a feudal system of government based in Kamakura in which the military, the samurai, assumed all political power while the Emperors of Japan in Kyoto remained the figurehead de jure rulers. In 1192 Yoritomo was awarded the title of Seii Taishogun by the emperor and the political system he developed with a succession of shogun at the head became known as a bakufu or Shogunate. From this point in history, all shogun by tradition were descendents of the Minamoto princes, the sons of emperor Saga. The title was passed generation to generation to the eldest sons.
In Japanese history, besides Minamoto no Yoritomo whose Kamakura shogunate lasted for for approximately 150 years, from 1192 to 1333, only Ashikaga Takauji and Tokugawa Ieyasu, each being descendants of the Minamoto princes, were awarded the title of Seii Taishogun and established bakufu on their own right. The Ashikaga shoguns ruled from 1338 to 1573, while the Tokugawa shoguns ruled from 1603 to 1868.
The so-called Transitional shoguns of 1568-1598 were never given the title of Seii Taishogun by the emperor and did not establish bakufu, but did for a period hold power over the emperor and most/all of Japan.
The title Seii Taishogun was abolished during the Meiji Restoration in 1868, in which effective power was "restored" to the emperor and his appointees.