The Visuddhimagga or the Path of Purification by Ven. Buddhaghosa talks about this. Please see "Path of Purification (Visuddhimagga)", translated from Pali by Ven. Ñāṇamoli. It's a classic manual of Buddhist doctrine and meditation written in approximately the 5th century CE, and is considered the most important Theravada text outside the Pali Canon and its traditional commentaries.
It talks about the eight knowledges of insight:
Now, insight reaches its culmination with the eight
knowledges, and knowledge in conformity with truth is ninth; these
are what is called purification by knowledge and vision of the
way.The eight should be understood as follows: (1) knowledge
of contemplation of rise and fall, which is insight free from
imperfections and steady on its course,(2) knowledge of contemplation
of dissolution, (3) knowledge of appearance as terror, (4) knowledge
of contemplation of danger, (5) knowledge of contemplation of
dispassion, (6) knowledge of desire for deliverance, (7)
knowledge of contemplation of reflection, and (8) knowledge of
equanimity about formations.
“Knowledge in conformity with truth
as ninth” is a term for conformity.So one who wants to perfect
this should make these kinds of knowledge his task, starting with
knowledge of rise and fall free from imperfections.
The description of (3) knowledge of appearance as terror:
As he repeats, develops and cultivates in this way the
contemplation of dissolution, the object of which is cessation
consisting in the destruction, fall and breakup of all formations,
then formations classed according to all kinds of becoming,
generation, destiny, station, or abode of beings, appear to him in the
form of a great terror, as lions, tigers, leopards, bears, hyenas,
spirits, ogres, fierce bulls, savage dogs, rut-maddened wild
elephants, hideous venomous serpents,thunderbolts, charnel
grounds, battlefields, flaming coal pits, etc., appear to a
timid man who wants to live in peace. When he sees how past formations
have ceased, present ones are ceasing, and those to be
generated in the future will cease in just the same way,
then what is called knowledge of appearance as terror arises
in him at that stage. ...
But does the knowledge of appearance as terror [itself] fear
or does it not fear? It does not fear. For it is simply the mere
judgment that past formations have ceased, present ones are ceasing,
and future ones will cease. Just as a man with eyes looking at
three charcoal pits at a city gate is not himself afraid,
since he only forms the mere judgment that all who fall into
them will suffer no little pain;—or just as when a man with
eyes looks at three spikes set in a row, an acacia spike,
an iron spike, and a gold spike, he is not himself afraid,
since he only forms the mere judgment that all who fall on
these spikes will suffer no little pain;—so too the knowledge of
appearance as terror does not itself fear; it only forms the mere
judgment that in the three kinds of becoming, which resemble the three
charcoal pits and the three spikes, past formations have ceased,
present ones are ceasing, and future ones will cease.
The description of (4) knowledge of contemplation of danger:
As he repeats, develops and cultivates the knowledge of
appearance as terror he finds no asylum, no shelter, no place to go
to, no refuge in any kind of becoming, generation, destiny,
station, or abode. In all the kinds of becoming,generation,
destiny, station, and abode there is not a single formation that he
can place his hopes in or hold on to. The three kinds of becoming
appear like charcoal pits full of glowing coals, the four
primary elements like hideous venomous snakes (S IV 174), the five
aggregates like murderers with raised weapons (S IV174), the six
internal bases like an empty village, the six external bases
like village-raiding robbers (S IV 174–75), the seven stations
of consciousness and the nine abodes of beings as though
burning, blazing and glowing with the eleven fires (see S IV
19), and all formations appear as a huge mass of dangers
destitute of satisfaction or substance, like a tumour, a disease, a
dart, a calamity,an affliction (see M I 436). How?
They appear as a forest thicket of seemingly pleasant aspect
but infested with wild beasts, a cave full of tigers, water haunted
by monsters and ogres, an enemy with raised sword, poisoned food,
a road beset by robbers, a burning coal, a battlefield between
contending armies appear to a timid man who wants to live in peace.
And just as that man is frightened and horrified and his
hair stands up when he comes upon a thicket infested by wild
beasts, etc., and he sees it as nothing but danger, so too
when all formations have appeared as a terror by contemplation
of dissolution, this meditator sees them as utterly destitute of any
core or any satisfaction and as nothing but danger.
Apparently, this will transition into a knowledge of peace:
“He contemplates as suffering
Arising, occurrence, and the sign,
Accumulation, rebirth-linking —
And this his knowledge is of danger.
“He contemplates as bliss no arising,
And no occurrence, and no sign,
No accumulation, no rebirth-linking —
And this his knowledge is of peace.
“This knowledge about danger has
Five sources for its origin;
Knowledge of peace has also five —
Ten knowledges he understands.
Knowledge of the state of peace is this: “Non-arising is safety,”
etc.: this, however, should be understood as said for the purpose of
showing the opposite kind of knowledge to knowledge of danger. Or when
it is stated in this way, that there is safety without terror and
free from danger, it is for the purpose of comforting those who are
upset in their hearts by seeing danger through appearance as terror.
Or else, when arising, etc., have clearly appeared to a man as
terror, his mind inclines towards their opposites, and so this is
said for the purpose of showing the advantages in the knowledge of
danger established by the appearance as terror.
So, the mind first sees the terror of the inevitability of the cessation of phenomena, and then experiences danger when it realizes that there is no place to cling to for safety from the inevitability of the cessation of phenomena. Finally, it accepts this situation, and sees non-arising etc. as safety.
Hence, to me, the knowledge of appearance as terror and knowledge of contemplation of danger sound like the increasing of suffering as one progresses on the path to liberation.