In the following talk, it is described that the five hindrances, namely, sensual desire, ill will, sloth and torpor, restlessness and remorse, and doubt, do not just affect a person in meditation. It also affects a person at other times. The five hindrances obsess the mind and enslave the mind. They also appear habitually.
The speaker says that people who commit acts of crime like raping their own daughter, are strongly deluded and enslaved by the hindrances.
Only after attaining and mastering the first jhana, do the five hindrances reduce to a very low level that is not significant enough to be considered hindrances any more. After attaining the fourth jhana, the five hindrances are nearly completely eliminated.
The speaker says that a person who has overcome the five hindrances is capable of yoniso manasikara (focused attention or careful attention). With this, a person could attain stream entry simply by listening to the true Dhamma (teachings) attentively and reflecting on it. This is based on SN 55.5.
So, why do moments of mindlessness occur? It's due to the presence of the five hindrances.
In the YouTube video entitled "Characteristics of a Sotapanna" at timestamp 25:52, Ven. Dhammavuddho Mahathera stated (with some paraphrasing):
The third condition, this word - yoniso manasikara, which I
translate as focused attention. It is also known as careful attention.
This word means that when you listen to the Dhamma, you are focused on
listening to the Dhamma. In other words, at that time, you don't have
the five hindrances. If that is so, then you can understand the Dhamma
and attain stream entry.
So who are the people who do not have the five hindrances? In the
suttas, it is stated by the Buddha that as long as a person has not
attained piti and sukha which are secluded from unwholesome
states, which are secluded from sensual pleasures, the five hindrances
will obsess him and obsess him habitually.
So, there are two types of persons who do not have the five
hindrances. The first is the one who has attained the first jhana
(i.e. he who has attained piti and sukha). When a person has attained
the first jhana, he has eliminated the five hindrances and the Buddha
says that the five hindrances no longer obsess that person habitually.
...
So there are two conditions if a person has the hindrances. Firstly,
it obsesses your mind, it enslaves your mind. Secondly, it is
habitual, it is very often there. That's why when
somebody rapes his daughter or rapes his granddaughter,
it's because he cannot control these hindrances. His
hindrances overwhelms his mind, obsesses the mind. After a person
attains the first jhana, the Buddha says that the five hindrances are
eliminated.
A lot of people don't believe it because they don't really understand
the hindrances. If I ask you what are the hindrances, a lot of people
will say sensual desire, ill will, sloth and torpor, restlessness and
worry, and doubt. But these are not the five hindrances. These are
called the five hindrances only when they obsess your mind, when they
enslave your mind and they recur habitually. Only then they are called
the five hindrances.
When a person attains the first jhana, these five hindrances reduce to
a low level. They are still there but they are not called hindrances
any more. It's just as if you walk through a jungle, you may
encounter seven foot high long grass obstructing you. It's a
hindrance because when you try to go through it, you cannot see in
front of you. Secondly, it cuts or injures your skin. So, it's a big
hindrance. But if I cut down that long grass to 12 inches, it is no
more a hindrance. But it is still observable.
So, when a person attains the first jhana,
it's as if the seven foot high long grass has
been cut down to 12 inches. When he attains the second jhana,
the 12 inches becomes 8 inches.
When he attains the third jhana, it becomes 4
inches. When he attains the fourth jhana, it becomes one millimeter.
So there is a big difference between the first three jhanas and the
fourth jhana.
That is why it is said that once a person attains the first jhana, the
hindrances are (nearly) eliminated,
meaning generally (nearly) eliminated for good.