主公 was used in ancient China (especially the Three Kingdoms period) by subordinates to address their lord or warlord. It conveys loyalty and feudal hierarchy.
culture
Very common in Chinese historical dramas, novels (especially 《三国演义》), and strategy games. In modern Chinese, it's only used in historical contexts or humorously.