The word 잡다 means "to grab," and the word 우이 (牛耳) is a Sino-Korean word (한자어) that literally means "a cow's (牛) ear (耳)." But besides meaning "cow's ear," 우이 can also mean "the leader" or "the head," which seems a little strange to me. Why would "a cow's ear" mean "a leader" or "the head"?
Though the phrase 우이를 잡다 literally means "to grab a cow's ear," it translates as "to take the leadership of," "to lead," or "to head." That suggests that grabbing and pulling on a cow's ear is one way to lead the cow around, and that means that the person who is grabbing and pulling on the cow's ear is "the leader." So, maybe that is how the word "cow's ear" (牛耳 우이) came to mean "the leader." In other words, maybe 우이 (牛耳) is just an abbreviation of 우이 (牛耳)를 잡는 사람, which translates as "a person who grabs a cow's ear."
By the way, is it just a coincidence that another Korean word for "a leader" or "a boss" is 우두머리? The pure-Korean word for "head" is 머리, but what does the 우두 in 우두머리 mean? Could it mean "cow's (牛 우) head (頭 두)," and then 머리 is just added for clarity? I don't know, but cows are led around by their heads, and maybe their ears, so being a leader in Korea may be someone who knows how to lead both cows and people.
Finally, the word 우이 (牛耳) is also used in the Chinese idiom 우이독경 (牛耳讀經), which literally means "[in] a cow's ear (牛耳), read aloud (讀) scripture (經)," which would be a waste of time since the cow would not understand what is being read to it. So, it would be like "talking to a brick wall" or "preaching to the wind."