I saw this behavior while in Wyoming (although I never saw the Mustangs responsible).
A stud pile is when a stallion leaves droppings to mark his presence. The next stallion to come by will deposit his manure in the same place. Then the first stallion comes back and...eventually, you end up with quite the pile of horse dung. They're leaving a signpost of their presence and keeping track of each other - as well as marking territory.
Domestic stallions will do the same thing (and both mares and geldings will inspect a pile of poop to see who left it and make sure it's a member of their herd rather than a stranger). In fact, stallions are easier to muck out after than mares or geldings, because they will actually always poop in the same corner of their stall. To make things even easier, they tend to pee on the pile too. Some geldings, especially if castrated after puberty, will exhibit the same behavior.