I don't know if this is an acceptable top level answer as my source is myself. I'm a bit of a pigeon expert with over 20 years experience.
Pigeons weren't trained in the way most people may view them. You don't just turn them loose and expect them to know where to go like the owls in Harry Potter.
Say you and I are friends that live across town and we use pigeons to send letters back and forth. What we would do is both raise pigeons and exchange some. My pigeons will know to return to my house and your pigeons will know to return to yours. They have an innate sense of where "home" is even if it's just a wooden box in someone's back yard. They are able to use this ability for hundreds of miles.
In times of war, all you'd have to do is take some pigeons from their loft/cote and bring them with you to wherever you're going - releasing however many necessary when the time comes.
Pigeons have been used like this in times of war for centuries. Some have even been given medals for their service. Cher Ami being a very famous example.
hi! there's always room for more information, but FYI there's a section on carrier pigeons in this section of the FAQ