Demons gain control in several ways:
Through generations:
Demons may oppress or possess a person because of previous possession or oppression of the parents. This accounts for demonic influence over children.
Exodus 20:5:
"Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;"
Exodus 34:7:
"Keeping mercy for thousands, forgiving iniquity and transgression and sin, and that will by no means clear the guilty; visiting the iniquity of the fathers upon the children, and upon the children's children, unto the third and to the fourth generation."
Deuteronomy 5:9:
"Thou shalt not bow down thyself unto them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me,"
Through the mind:
The mind is one of the major battlefields of satan. If satan controls your thoughts, he will eventually control your actions. Lack of mental control eventually results in lack of use of the will. This leads to sinful actions. Continuing in sinful thoughts and actions can lead from oppression to possession and finally to a reprobate mind such as is described in Romans l - a mind totally controlled by evil thoughts.
Demons also gain access through mind-altering drugs, which reduce the ability to resist demons and grant increasing access. "Brainwashing" or "mind-control" teaching also provides an entrance point.
Through sinful actions:
Sinful thoughts are soon fulfilled by sinful actions. For example, the thought of adultery is fulfilled in the actual act of adultery. Sin is rebellion, and rebellious thoughts and actions provide an entry point for demonic activity.
When a believer continues in sinful thoughts or actions they "give place" to the Devil (Ephesians 4:27). More spiritual room is given for the operation of the enemy. Sins of involvement with the occult, including objects, literature, seances, etc., are actions that are especially dangerous and attract demonic powers.
Ephesians 4:27:
Neither give place to the devil.
An unbeliever who lives in sin is open not only to oppression of demonic powers, but also possession. There is no neutral ground in spiritual warfare. You are either on the side of good or evil. You belong either to God or satan. If you belong to satan and have not experienced the new birth in Jesus Christ, then you are his to use, oppress, or possess as he wills.
Through desire: Some people ask satan for demonic power to enable them to perform supernatural acts.
Through an empty house:
Demons consider the body of the person they inhabit as their own house:
Matthew 12:43-45:
43 "When the unclean spirit is gone out of a man, he walketh through dry places, seeking rest, and findeth none.
44 Then he saith, I will return into my house from whence I came out; and when he is come, he findeth it empty, swept, and garnished.
45 Then goeth he, and taketh with himself seven other spirits more wicked than himself, and they enter in and dwell there: and the last state of that man is worse than the first. Even so shall it be also unto this wicked generation."
When a person who is delivered from demonic powers does not fill his house with the new birth experience and the infilling of the Holy Spirit, reentry may occur.
Through permission:
Sometimes God grants permission for demonic powers to accomplish special purposes. This can be evidenced by a trial, as in the case of Job, or judgment for sin, as in the example of King Saul.