And it is told in the Lay of Leithian, which is the Release from Bondage, that when the company of Beren and Finrod Felagund passed Tol Sirion (which Finrod himself had built), their disguise was challenged by Sauron, the master of the tower. And before the gates of the tower was a great contest for the mastery, between Finrod Felagund King of Nargothrond, and Sauron Gorthaur the Vassal of Morgoth. The Lay of Leithian reads...

He chanted a song of wizardry,
Of piercing, opening, of treachery,
Revealing, uncovering, betraying,

Sauron is often referred to throughout the saga of Middle-earth as a lord of treachery. He betrayed his lords the Valar to serve Morgoth, and much later in history betrayed the elves of Eregion by creating and using the One Ring. Thus it is in his nature to attempt to unmask the company of Beren and Finrod.

Then sudden Felagund there swaying,
Sang in answer a song of staying,
Resisting, battling, against power,
Of secrets kept, strength like a tower,

Finrod Felagund was the King of Nargothrond, a hidden kingdom of the elves in the west part of Beleriand. He was also the original architect of Tol Sirion, which is the tower to which the poem makes reference. Here he attempts to stay the hand of Sauron in revealing the kind of their company.

Of trust unbroken, freedom, escape,
Of changing and of shifting shape,

Finrod Felagund is called "the Faithful" for his oath to Barahir, which he redeems soon after these events. The "trust unbroken" line foreshadows his keeping of his oath unto death. The "shifting shape" line simply refers to his efforts (by the art of the elves) to disguise their company from Sauron.

Of snares eluded, broken traps,
The prison opening, the chain that snaps.

The second line here can be interpreted as a vague foreshadowing of when Finrod (shortly after this) breaks his bonds to save Beren from death, thereby redeeming his oath forever.

Backwards and forwards swayed their song,
Reeling and foundering as ever more strong,
The chanting swelled and Felagund fought,
And all the magic and might he brought,
Of Elvenesse into his words,

Here the "might of Elvenesse" is a reference to all the power and lore of the Noldor, always considered the mightiest of all the elves in art and craft of all kinds, including the magical power that Finrod now wields. That he had to marshal such powers to contest with Sauron is a testament to the Maiar's power.

Then in the gloom they heard the birds,
Singing afar in Nargothrond,
The sighing of the Sea beyond,
Upon the western shores on sand,
On sand of pearls in Elven-land.

The reference here is to the land the Noldor forsook, the deathless land, Aman. Aman and Eldamar represent the pinnacle of Elven and Valarin power, which would certainly be capable of defeating Sauron if fully unleashed. The reference to the Sea is likewise a reminder that the true hope of the Elves "lieth in the West, and cometh from the Sea." (Words of Ulmo the Valar to Turgon the Wise.)

Then the gloom gathered, darkness growing,
In Valinor the red blood flowing,
Beside the Sea where the Noldor slew,
The Foamriders, and stealing drew,
Their white ships with their white sails,
From lamp-lit havens, the wind wails,

This refers to the Kinslaying, where Fëanor and his sons attacked the Teleri at Alqualondë and stole their white ships to cross the Sea to Middle-earth. This act doomed the Noldor and caused their exile and eventual failure in the lands of mortals. This passage is intended to show (symbolically) Sauron gaining the upper hand in the battle.

The wolf howls, the ravens flee,
The ice mutters in the mouths of the Sea,

These lines refer to the betrayal of Fingolfin by Fëanor, which resulted in Fingolfin's trek with his kindred across the Helcaraxë (the Grinding Ice) into Middle-earth. The muttering of the ice tells the tale of the doom of the Noldor.

The captives sad in Angband mourn,
Thunder rumbles, the fires burn,
And Finrod fell before the throne.

The captives in Angband here refer to those lost in the battles of the Noldor with Morgoth, which they are destined to lose by the Curse of Mandos. Now, on the Quest of the Silmaril, Finrod is also subject to that Curse and so he is defeated by Sauron, and their band is taken prisoner and cast into the pits of Tol-in-Gaurhoth, the Isle of Werewolves.

Sources

J.R.R. Tolkien. The Silmarillion. New York: Houghton Mifflin, 2001.