Unlike in the real world, Starfleet has direct contact with alien governments. In the real world, it typically would not be admirals or ship commanding officers who would directly contact/liaise with governments. An example is Chancellor K'mpec asking Picard to be an Arbiter of Succession.
In most real life foreign contacts, either the head of government and/or head of state would hold high-level discussions with other sovereign states, backed up by a state diplomatic corps. An army general or a naval admiral wouldn't generally get involved.
Is Starfleet thus a part military and part political arm of the Federation, unlike real world armed forces?