Complex sentence: It was used to contain Melkor on two occasions in the First Age; both occasions followed Melkor's defeat in epic battles with the Valar.
Split into simpler sentences: It was used to contain Melkor on two occasions in the First Age. Both occasions followed Melkor's defeat in epic battles with the Valar.