When the epic opens, Gilgamesh is an arrogant and strong man. He focuses on his strength and lets no one speak against him.
In Tablet 1, Gilgamesh is strutting around very proud of himself.
He walks around in the enclosure of Uruk,
Like a wild bull he makes himself mighty, head raised (over others).
There is no rival who can raise his weapon against him. (Tablet 1)
He is described as “bold, eminent, knowing, and wise!” (Tab 1), but this seems to be more his perception of himself than others’ perception of him, because the people of Uruk ask the gods to intervene.
Perhaps Gligamesh was just lonely, because the gods seem to have an answer. They decide to make him a friend who can be his equal.
"it was you, Aruru, who created mankind(?),
now create a zikru to it/him.
Let him be equal to his (Gilgamesh's) stormy heart,
let them be a match for each other so that Uruk may find peace!" (Tablet 1)
This is how Erikdu is created, and he learns that Glgamesh is “wise to perfection” but decides to challenge him. They do fight, but Gilgamesh is thrilled to have an equal and they become great friends.
Gilgamesh’s arrogant and unchecked power seems to have created a moral void that Erikdu was able to fill. Erikdu’s presence as a friend and someone who could check Gilgamesh made him very valuable. Gilgamesh is able to adventure with his new friend and learn to be a better ruler.