The leader you follow generally had command over you in the military hierarchy.
For instance, Antipater was in command of Macedonian forces garrisoning Greece, he would use this army to quell the Greek uprisings.
Of course that being said loyalty could be a rather ephemeral thing, Perdicass was assassinated by his own army officers for example.