The phrase refers to someone who acts more important than others in a group.
Example of use: "Jaime loved acting the cock of the walk and ordering everyone around."
The origin of the idiom “cock of the walk” isn’t known, but this slang term has been in use for more than two hundred years. One story says that in the early 1800s, boatmen traveling the Mississippi River held prize fights between champion fighters from different boats for entertainment. The winner was awarded the title “Cock of the walk” meaning “best of the best”.