Herdsmen were often seen as being on the boundaries of civilisation, necessary but also capable of turning on those whom they supply. But by the time of the Odyssey, Hermes' main function was as the messenger of the other Gods, particularly for Zeus whom he greatly respected. His many titles reflect both his speed, and also his good humour and beneficience. Originally he seems to have been a mainly Arcadian God of the herdsmen, like Pan, responsible for their fertility and general abundance. As the shepherd and travellers friend, the herm marked the course of ancient pathways and were also used outside houses for protection.
Boundaries are important in understanding the nature of Hermes.
Boundary stones are the link between the old and the new, one state and another, one path and the next path. Cross this boundary and something changes. In some myths t is the trickster God who founds civilisation. And it is not difficult to see how the God of boundaries could also become the messenger of the Gods, transmuting their will into a message to humankind. Transgressing boundaries is also associated with taboo's, the breaking down of order.