Let's start with the investigation. lt will depend largely on a variety of factors, including who's the complainant, who's the victim, and who is the alleged offender. There will be discussions between the national investigation service of the military police and the civilian police of jurisdiction if there is doubt as to whether the civilian police would be better suited to investigate, given all of these factors.
Once the investigation is completed, if it has been investigated by the civilian police, there could be a transfer back to the military. At that point there might be sufficient information to indicate that the military justice system would be better suited to prosecute the case, or it may be that it will stay within the civilian system and it will be the court of civilian jurisdiction that will prosecute.
It is an issue of what's best suited, given the specific circumstances of the case at hand. These circumstances are looked at very closely by the different actors.