A court martial is a military court. Its role is to punish members of the military, using military law. It is also used to try enemy prisoners of war for war crimes.
Prisoners of war must be given the same treatment during courts martial as an army's own soldiers. This is written in the Geneva Conventions, which are a set of international treaties to protect people's human rights during wartime.