On one occasion the Blessed One was living at Savatthi in Jeta's Grove, Anathapindika's Park. There he addressed the bhikkhus thus: "Bhikkhus, a deer-trapper does not lay down bait for a deer herd intending thus: 'May the deer herd enjoy this bait that I have laid down and so be long-lived and handsome and endure for a long time.' A deer-trapper lays down bait for a deer herd intending thus instead: 'The deer herd will eat food unwarily by going right in amongst the bait that I have laid down; by so doing they will become intoxicated; when they are intoxicated, they will fall into negligence; when they are negligent, I can do with them as I like on account of this bait.'
"Now the deer of the first herd encroached the deer feeder's encroachment, ate the fodder, swooned, became intoxicated and negligent, and became subjects to the wishes of the deer feeder. That is how the deer of the first herd failed to get free from the deer trapper's power and control."
Now the deer of a second herd reckoned thus: 'The deer of that first herd, by acting as they did without precaution, failed to get free from the deer-trapper's power and control. Suppose we altogether shun that bait food; shunning that fearful enjoyment, let us go out into the forest wilds and live there.' And they did so. But in the last month of the hot season when the grass and the water were used up, their bodies were reduced to extreme emaciation; with that they lost their strength and energy. Then they went back to the deer feeder ate the fodder, swooned, became intoxicated and negligent, and became subjects to the wishes of the deer feeder, in that same encroachment. That is how the deer of the second herd also failed to get free from the deer-trapper's power and control."
"Now the deer of a third herd reckoned thus: 'The deer of that first herd, by acting as they did without precaution, failed to get free from the deer-trapper's power and control. The deer of that second herd, by reckoning how the deer of the first herd had failed and by planning they tried to live in the forest wilds but also failed to get free from the deer-trapper's power and control. Suppose we make our dwelling place within range of the deer-trapper's bait. Then we shall eat food not unwarily and without going right in to the bait, by doing so we shall not become intoxicated; we shall not fall into negligence; when we are not negligent, the deer-trapper shall not do with us as he likes on account of that bait.' And they did so. But then the deer-trapper and his following considered thus: 'These deer of this third herd are as cunning and crafty as wizards and sorcerers. They eat the bait laid down without our knowing how they come and go. Suppose we have the bait that is laid down completely surrounded all round over a wide area with wicker hurdles; then perhaps we might see where the third deer herd's dwelling place are.' They did so, and they saw where the third herd hide. And that is how the deer of the third herd also failed to get free from the deer-trapper's power and control. "
"Now the deer of a fourth herd reckoned thus: "The deer of that first herd, by acting as they did without precaution, failed to get free from the deer-trapper's power and control. The deer of that second herd, by reckoning how the deer of the first herd had failed despite taking the precaution of going to live in the forest wilds, also failed to get free from the deer-trapper's power and control. And the deer of that third herd, by reckoning how the deer of the first herd and also the deer of the second herd had failed, and by planning and acting as they did with the precaution of making their dwelling place within range of the deer-trapper's bait, also failed to get free from the deer-trapper's power and control. Suppose we make our dwelling place where the deer-trapper and his following cannot go. Then, having done so, we shall eat food not unwarily and without going right in amongst the bait that the deer-trapper has laid down; by doing so we shall not become intoxicated; we shall not fall into negligence then the deer-trapper shall not do with us as he likes on account of that bait.'
And they did so. "But then the deer-trapper and his following considered thus: 'These deer of this fourth herd are as cunning and crafty as wizards and sorcerers. They eat the bait laid down without our knowing how they come and go. Suppose we have the bait that is laid down completely surrounded all round over a wide area with wicker hurdles; then perhaps we might see the fourth deer herd's dwelling place, where they go to hide.' They did so, but they did not see the fourth deer herd's dwelling place. Then the deer-hunter and his following considered thus: 'If we scare the fourth deer herd, being scared they will alert others, and so the deer herds will all desert this bait that we have laid down. Suppose we treat the fourth deer herd with indifference.' They did so. And that was how the deer of the fourth deer herd got free from the deer-trapper's power and control.
"Bhikkhus, I have given this simile in order to convey a meaning. 'Bait' is a term for the five cords of sensual pleasure. 'Deer-trapper' is a term for Mara the Evil One. 'The deer-trapper's following' is a term for Mara's following. 'Deer herd' is a term for recluses and brahmins."
"Now recluses and brahmins of the first kind ate food unwarily by going right in amongst the bait and the material things of the world that Mara had laid down; by so doing they became intoxicated; they fell into negligence. When they were negligent, Mara did with them as he liked on account of that bait and those material things of the world. That is how the recluses and brahmins of the first kind failed to get free from Mara's power and control. "
"Now recluses and brahmins of the second kind reckoned thus: 'Those recluses and brahmins of the first kind, by acting as they did without precaution, failed to get free from Mara's power and control. Suppose we shun that bait food and those material things of the world; shunning that fearful enjoyment, let us go out into the forest and live there.' And they did so. There they were eaters of greens or millet or rice-bran or the discarded scum of boiled rice or grass or cow dung; they lived on forest roots and fruits. But in the last month of the hot season when the grass and the water were used up, their bodies were reduced to extreme emaciation; with that they lost their strength and energy; they lost their deliverance of mind;they returned to that same bait that Mara had laid down and those material things of the world; they ate food unwarily by going right in amongst it; by so doing they became intoxicated; they fell into negligence; Mara did with them as he liked on account of that bait and those material things of the world. That is how those recluses and brahmins of the second kind failed to get free from Mara's power and control. "
"Now recluses and brahmins of the third kind reckoned thus: "Those recluses and brahmins of the first kind, by acting as they did without precaution, failed to get free from Mara's power and control. Those recluses and brahmins of the second kind, by reckoning how the recluses and brahmins of the first kind had failed, they did with the precaution of going to live in the forest wilds, also failed to get free from Mara's power and control. Suppose we make our dwelling place within range of that bait that Mara has laid down and those material things of the world. Having done so, we shall eat food not unwarily and without going right in amongst the bait that Mara has laid down and the material things of the world. By doing so we shall not become intoxicated; we shall not fall into negligence; when we are not negligent, Mara shall not do with us as he likes on account of that bait and those material things of the world.' And they did so.
But then they came to hold views such as 'the world is eternal' and 'the world is not eternal' and 'the world is finite' and 'the world is infinite' and 'the soul and the body are the same' and 'the soul is one thing and the body another' and 'after death a Tathagata exists' and 'after death a Tathagata does not exist' and 'after death a Tathagata both exists and does not exist' and 'after death a Tathagata neither exists nor does not exist.' That is how those recluses and brahmins of the third kind failed to get free from Mara's power and control. Those recluses and brahmins, I say, are just like the deer of the third herd. "
"Now recluses and brahmins of the fourth kind reckoned thus: 'Those recluses and brahmins of the first kind, by acting as they did without precaution, failed to get free from Mara's power and control. Those recluses and brahmins of the second kind, by reckoning how the recluses and brahmins of the first kind had failed, they go to live in the forest wilds, also failed to get free from Mara's power and control. And the recluses and brahmins of the third kind, by reckoning how the recluses and brahmins of the first kind and also the recluses and brahmins of the second kind had failed, they make their dwelling place within range of the bait that Mara had laid down and the material things of the world, also failed to get free from Mara's power and control. Suppose we make our dwelling place where Mara and his following cannot go. Then, having done so, we shall eat food not unwarily and without going right in amongst the bait that Mara has laid down and the material things of the world. By doing so we shall not become intoxicated; we shall not fall into negligence; then Mara shall not do with us as he likes on account of that bait and those material things of the world.' And they did so. And that is how those recluses and brahmins of the fourth kind got free from Mara's power and control. Those recluses and brahmins, I say, are just like the deer of the fourth herd. "
"And where is it that Mara and his following cannot go? Here, quite secluded from sensual pleasures, secluded from unwholesome states, a bhikkhu enters upon and abides in the first jhana, which is accompanied by applied and sustained thought, with rapture and pleasure born of seclusion. This bhikkhu is said to have blindfolded Mara, to have become invisible to the Evil One by depriving Mara's eye of its opportunity. Again, with the stilling of applied and sustained thought, a bhikkhu enters upon and abides in the second jhana, which has self-confidence and singleness of mind without applied and sustained thought, with rapture and pleasure born of concentration. This bhikkhu is said to have blindfolded Mara... "
"Again, with the fading away as well of rapture, a bhikkhu abides in equanimity, and mindful and fully aware, still feeling pleasure with the body, he enters upon and abides in the third jhana, on account of which the noble ones announce: 'He has a pleasant abiding who has equanimity and is mindful.' This bhikkhu is said to have blindfolded Mara... Then with the abandoning of pleasure and pain, and with the previous disappearance of joy and grief, a bhikkhu enters upon and abides in the fourth jhana, which has neither pain-nor-pleasure and purity of mindfulness due to equanimity. This bhikkhu is said to have blindfolded Mara... "
"Again, with the complete surmounting of perceptions of form, with the disappearance of perceptions of sensory impact, with non-attention to perceptions of diversity, aware that 'space is infinite', a bhikkhu enters upon and abides in the base of infinite space. This bhikkhu is said to have blindfolded Mara... Again, by completely surmounting the base of infinite space, aware that 'consciousness is infinite', a bhikkhu enters upon and abides in the base of infinite consciousness. This bhikkhu is said to have blindfolded Mara... Again, by completely surmounting the base of infinite consciousness, aware that 'there is nothing,' a bhikkhu enters upon and abides in the base of nothingness. This bhikkhu is said to have blindfolded Mara... Again, by completely surmounting the base of nothingness, a bhikkhu enters upon and abides in the base of neither perception-nor-non-perception. This bhikkhu is said to have blindfolded Mara, to have become invisible to the Evil One by depriving Mara's eye of its opportunity. "
"Again, by completely surmounting the base of neither perception-nor-non-perception, a bhikkhu enters upon and abides in the cessation of perception and feeling. And his taints are destroyed by his seeing with wisdom. This bhikkhu is said to have blindfolded Mara, to have become invisible to the Evil One by depriving Mara's eye of its opportunity, and to have crossed beyond attachment to the world."
That is what the Blessed One said. The bhikkhus were satisfied and delighted in the Blessed One's words.
The Buddha uses the analogy of deer trappers setting up bait to capture deer, to let the bhikkhus know the obstacles that confront them in their effort to escape from Mara's control. 'Bait' is a term for the five cords of sensual pleasure. 'Deer-trapper' is a term for Mara the Evil One. 'The deer-trapper's following' is a term for Mara's following. 'Deer herd' is a term for recluses and brahmins." Where is it that Mara and his following cannot go? That's when Bhikkhus abide in the 4 rupa jhanas and 4 arupa jhanas. When the bhikkhu has destroyed all his taints, gained knowledge and insight wisdom, by cutting off the links of dependent origination, with no more rebirth then he is no longer subjected to Mara's control.
References: 1. www.accesstoinsight.org 2. https://suttacentral.net/ 3. The long discourses of the Buddha (Bhikkhu Bodhi)