A demon (or devil) is defined as an unclean spirit.
Luke 9:42 And as he was yet a coming, the devil (demon) threw him down, and tare him. And Jesus rebuked the unclean spirit, and healed the child, and delivered him again to his father.
As such a ‘demon’ is the unclean spirit of a man, not a separate entity.
The spirit of a man can be unclean by reason of mental illness or it can be unclean in designing a false god after his own imagination and making rules to worship it.
The origin of idols is not a separate spirit entity.
All idols are designed within and by the minds of men.
Romans 1:21 Because that, when they knew God, they glorified him not as God, neither were thankful; but became vain in their imaginations, and their foolish heart was darkened. 22 Professing themselves to be wise, they became fools, 23 And changed the glory of the uncorruptible God into an image made like to corruptible man, and to birds, and fourfooted beasts, and creeping things.
An idol represents an idea formed in the mind of man, it has no substance or power beyond the man’s imagination.
It is because these idols and the ideas they represent have no actual power that worshipping them is futile.
God told Israel not to make idols.
Exodus 20:1 And God spake all these words, saying, 2 I am the LORD thy God, which have brought thee out of the land of Egypt, out of the house of bondage. 3 Thou shalt have no other gods before me. 4 Thou shalt not make unto thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth: 5 Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God,
Israel made the mistake of going after idols designed by ‘devils’ – the unclean spirits of men.
Deuteronomy 32:17 They sacrificed unto devils, not to God; to gods whom they knew not, to new gods that came newly up, whom your fathers feared not.
The even went as far as to imagine that these fictitious gods demanded human sacrifice.
Psalms 106:37 Yea, they sacrificed their sons and their daughters unto devils,
Elijah on mount Carmel in 1 kings 18 challenged the prophets of Baal and proved that the god did not exist.
1 Corinthians 10:20 But I say, that the things which the Gentiles sacrifice, they sacrifice to devils, and not to God: and I would not that ye should have fellowship with devils. 21 Ye cannot drink the cup of the Lord, and the cup of devils: ye cannot be partakers of the Lord’s table, and of the table of devils.
God must be worshipped in truth.
John 4:24 God is a Spirit: and they that worship him must worship him in spirit and in truth.
The first commandment is that we believe that there is one God and no other God but him.
Mark 12:32 And the scribe said unto him, Well, Master, thou hast said the truth: for there is one God; and there is none other but he:
We cannot worship God in truth if we also worship imaginary gods.
1 Timothy 4:1 Now the Spirit speaketh expressly, that in the latter times some shall depart from the faith, giving heed to seducing spirits, and doctrines of devils;
Seducing spirits and doctrines of devils (demons) don’t come from disembodied spirits, they are invented by men of corrupt minds.
A false idea begets a false idol, idols are still worshipped today.
Revelation 9:20 And the rest of the men which were not killed by these plagues yet repented not of the works of their hands, that they should not worship devils, and idols of gold, and silver, and brass, and stone, and of wood: which neither can see, nor hear, nor walk:
God, through Isaiah highlights the folly of making an idol.
Isaiah 44:10 Who hath formed a god, or molten a graven image that is profitable for nothing? 11 Behold, all his fellows shall be ashamed: and the workmen, they are of men: let them all be gathered together, let them stand up; yet they shall fear, and they shall be ashamed together. 12 The smith with the tongs both worketh in the coals, and fashioneth it with hammers, and worketh it with the strength of his arms: yea, he is hungry, and his strength faileth: he drinketh no water, and is faint. 13 The carpenter stretcheth out his rule; he marketh it out with a line; he fitteth it with planes, and he marketh it out with the compass, and maketh it after the figure of a man, according to the beauty of a man; that it may remain in the house. 14 He heweth him down cedars, and taketh the cypress and the oak, which he strengtheneth for himself among the trees of the forest: he planteth an ash, and the rain doth nourish it. 15 Then shall it be for a man to burn: for he will take thereof, and warm himself; yea, he kindleth it, and baketh bread; yea, he maketh a god, and worshippeth it; he maketh it a graven image, and falleth down thereto. 16 He burneth part thereof in the fire; with part thereof he eateth flesh; he roasteth roast, and is satisfied: yea, he warmeth himself, and saith, Aha, I am warm, I have seen the fire: 17 And the residue thereof he maketh a god, even his graven image: he falleth down unto it, and worshippeth it, and prayeth unto it, and saith, Deliver me; for thou art my god. 18 They have not known nor understood: for he hath shut their eyes, that they cannot see; and their hearts, that they cannot understand. 19 And none considereth in his heart, neither is there knowledge nor understanding to say, I have burned part of it in the fire; yea, also I have baked bread upon the coals thereof; I have roasted flesh, and eaten it: and shall I make the residue thereof an abomination? shall I fall down to the stock of a tree? 20 He feedeth on ashes: a deceived heart hath turned him aside, that he cannot deliver his soul, nor say, Is there not a lie in my right hand?
And again, through Habakkuk.
The whole process of making a god from conception to completion is a lie.
Habakkuk 2:18 What profiteth the graven image that the maker thereof hath graven it; the molten image, and a teacher of lies, that the maker of his work trusteth therein, to make dumb idols? 19 Woe unto him that saith to the wood, Awake; to the dumb stone, Arise, it shall teach! Behold, it is laid over with gold and silver, and there is no breath at all in the midst of it.
In conclusion, an idol is made to represent a ‘demon’, where ‘demon’ is a name given to the idea from the corrupt imagination of the man who invents it.
There is no ‘spirit world’ where malignant spirits exist.
The only opposition to God comes from within man.
May I suggest that you read ‘Demons - A Biblical and Historical Study’ here:
I hope you find this helpful.