The most simple answer would be the obvious; they're posing for a photograph.
To give you a longer answer, that about sums up trench life on the Western Front. Long periods of boredom, punctuated by a rotation out of the line and into the divisional reserve, then probably corps and army reserve, taking you away from the front entirely. You might engage in trench raids, but Tony Ashworth's research in the 80s indicated that a 'live and let live' system often held sway in quiet sectors. Unless your battalion, and by default your brigade/regiment and division, were involved in a major offensive, you probably wouldn't see much fighting. As for shell shock, in the case of the German and British armies these cases, which in reality covered a wide variety of physiological and psychological trauma that might not even count as PTSD today, made up no more than 10 percent of total casualties in the war, and at most 15-20 percent of combat casualties. Alexander Watson's excellent book Enduring the Great War is a must read for how German and British soldiers coped on the Western Front.