a person who holds authority over others or owns property: a master, owner, or (as polite address) sir
At its root the word names someone who has rightful power over a person or thing. In everyday Greek it covered the head of a household over his slaves, the owner of land, animals, or goods, and anyone whose say-so settled a matter. The New Testament uses it this plain way constantly, especially in parables drawn from ordinary life: a vineyard has its owner, slaves answer to their master, a steward serves the one who employs him.
The same word also worked as a courtesy. Greek had no separate word for our polite "sir," so a stranger, a superior, or simply someone you wished to honor could be addressed with this title without any claim that the person ruled you. The setting decides which is meant: the woman at the well calls Jesus this before she knows who he is, and it means no more than respectful "sir."
These two senses belong together because both rest on one idea: someone whose position calls for deference. The owner commands it by right; the person politely addressed is granted it by manners. Only the weight of the relationship changes.