"Shougun" is the chief of SAMURAI.
The position was given from "Tennou".
"Tennou" was the Japanese sovereign until after World War II and it was the same also at the time when SAMURAI governed Japan.
SAMURAI who wanted to be a "Shougun" defeated other SAMURAI and gave the Imperial Court much money and gift items.
The SAMURAI who became a "Shougun" obtains a right to establish their government(Bakufu(=Shogunate)).
In other words, Japan was ruled by two government while the Shogunate existed.
(The real power was held by the Shogunate.)
There are three SAMURAI who established Shogunate.
Minamoto no Yoritomo, Ashikaga Takauji, and Tokugawa Ieyasu.
The Shogunate was inherited by their descendant.