Again, there are two main areas in which it's determined. First is at the initial investigation stage, because particularly in Canada, we have multiple police forces that have jurisdiction. As the provost marshal indicated, if it's two members downtown, for example, then the starting position would be civilian police. If it's on base it's usually ours.
Once the charge is laid there can be further discussion at the prosecutorial level. The director of military prosecutions can chat with the local crown to determine if there are reasons, usually based on a complex series, such as the state of the victim, the best interest of justice, to either have the case heard in a civilian court or in a court martial.