Consonance has several definitions, and it can be used synonymously with alliteration to describe the repetition of initial consonant sounds in words which are near one another in a text. The repeated r sound at the beginning of the words "rifles' rapid rattle" seems to replicate the rolling sound of hundreds, perhaps thousands, of guns firing in quick succession. Consider how a person might rapidly roll their r's in order to approximate the sound of gunfire. This sound device produces a similar effect, and this is, of course, relevant to the text, which addresses war and the colossal injustice of it to everyone involved. The words "stuttering" and "rattle" are also examples of onomatopoeia, words that mimic the sounds they describe, and the combination of the consonance, the onomatopoeia, and the auditory image produced by these words makes the line seem, literally and figuratively, quite noisy.
In this first stanza, sound devices and auditory imagery abound, as, rather than the "passing-bells," soft "prayers," and "choirs" one might find at a typical funeral for the dead, the soldiers who die in war die like "cattle" and are only granted the harsh sound of gunfire and the "shrill, demented choirs of wailing shells." These soldiers are denied even the dignity and honor of a proper funeral and die amid the noise in a cacophonous battlefield. The consonance you've identified helps to create this loud scene, as opposed to the mood created by the second stanza, which relies most heavily on visual imagery. It is much more silent, much less noisy, than the first stanza because it depicts the people waiting for news back home. They wait, in silence, while their sons and brothers die, in deafening noise.