The comparison you mention is introduced in the third stanza of this incredible poem, as the speaker takes the sound of the tide going out and retreating from the land as a symbol of the way in which faith is declining in his land during his time, similarly leaving the modern world naked and exposed, just like the shingles on a beach. Note what this stanza says:

The Sea of Faith

Was once, too, at the full, and round earth's shore

Lay like the folds of a bright girdle furled.

But now I only hear

Its melancholy, long, withdrawing roar,

Retreating, to the breath

Of the night wind, down the vast edges drear

And naked shingles of the world.

In this stanza therefore the speaker reflects on how the "Sea of Faith" was once full and protected his land. Now, however, he hears the same "melancholy, long, withdrawing roar" as it receeds, leaving the modern world exposed and vulnerable, with its "naked shingles" showing. This comparison helps present Arnold's message that the decline in faith actually leaves the modern world in a very dangerous and weak position, tranforming it to a "darkling plain" where "ignorant armies crash by night."