In the early manuscripts of chants are to be found from time to time certain rather long melodic passages which recur, practically unchanged, in many different contexts: sometimes as a passage in a regular liturgical chant, sometimes included in a separate collection, and in either situation sometimes with words and sometimes without.
Long melismas of this sort came to be attached to the Alleluia in the liturgy -- at first simply as extensions of the chant but later, in still larger and more elaborate forms, as new additions. Such extensions and additions were given the name sequentia or "sequence" (from the Latin siquor, to follow), perhaps originally because of their position "following" the Alleluia.
When equipped with a text, the proper name for them is "prosa" alluding to the prose form of their texts -- though the same word "sequence" is often used loosely for both the texted and untexted versions.
The sequence or prosa early became detached from particular liturgical chants and began to blossom forth as an independent form of composition. In church, they may have been sung to the accompaniment of organ and bells. Popular sequences were also imitated and adapted to secular uses.
Most sequences were abolished from the Catholic service by the liturgical reforms of the Council of Trent (1545-63), and only four were retained in use: Victimae paschali laudes, at Easter; Veni Sancte Spiritus, on Whitsunday; Lauda Sion, by St. Thomas Aquinas, for the festival of Corpus Christi; and the Dies Irae. A fifth sequence, the Stabat Mater, was added in to the liturgy in 1727.