It was among the Nephite customs to never choose for their military leaders common men like themselves. In fact, they reached out to put their armies under the most spiritual and inspired men they could find among their military forces. And that is how Gidgiddoni happened to be chosen. Notice that Gidgiddoni, as the chief commander of the Nephites, was a prophet with the spirit of revelation.