The literal meaning of the term Brahmana is One who has attained Brahman
However , the term became the name of a caste based on birth rather than acheivement.

The Brahmanas alone had the authority to teach and learn the Vedas and the Upanishads , but there were many exceptions and several Kshatriya kings and indeed some Shudras did attain the Brahman and were acknowledged in various Hindu scriptures.
It was usual for the Brahmanas to give discourses to the ruler of the province and be rewarded handsomely if the king was impressed , but sometimes debates got ugly and Brahmanas cursed each other for not knowing the truth completely and met a wretched end!