Posing. All photographs were posed. On occasion a photographer could find troops at rest and when he could be assured they would not move during the long setup and exposure.
One of my favorites is the one taken in Frederick, Maryland from the second floor of a house down upon a Confederate column. One soldier, rifle on his shoulder, turns, looks up at the photographer. I tried to find a good copy online, but nothing very good. Maybe someone has a good copy to share.
Another good one is Union troops outside Petersberg