They squatted to shit into plastic bags, which they knotted and carried in their rucksacks for later disposal. They could not afford to have the enemy find and analyse their faeces to discover where they had come from and what they were eating.
See also Bottom of the World, Iraqi cubicle.
All mordern water-closets have an s-bend, which forms a water-trap or seal. British Standard 7358 requires a water seal with a minimum depth of 50mm. Every time the lavatory is flushed, the contents are removed, and the s-bend fills with clean water---at least, this should be the case.
To prevent gas bubbling up through the water trap, the vent pipe relieves any excess pressure at roof level.