No Single King
There is no actual "king of the barnyard." Roosters lead chicken flocks, bulls dominate cattle herds for breeding, boars lead pig herds, and rams lead sheep, but dominance is species-specific.
Cultural Perception
Which animal is considered "king" is more about cultural ideas than real-world dominance. Each animal plays a different role on the farm.