It works because these individuals are part of a shared experience, coming together to work towards a shared purpose in a structured regime that provides for their needs i.e. accommodation and food, but also provides a level of comradeship that many may not have experienced outside of the barracks.