Why did the emperor give the leader of the Minamoto family the title of shogun?

I think they did that because the emperor didn't want to give up being emperor

otherwise idk