To get a senses of what is being said, Young's Literal Translation of the Bible is useful. Also, it shoud be borne in mind that verses are a recent introduction and that punctuation was unknown in Hebrew. What we then have is:Exodus 20:4 `Thou dost not make to thyself a graven image, or any likeness which [is] in the heavens above, or which [is] in the earth beneath, or which [is] in the waters under the earth. Thou dost not bow thyself to them, nor serve them: for I, Jehovah thy God, [am] a zealous God, charging iniquity of fathers on sons, on the third [generation], and on the fourth, of those hating Me, 6 and doing kindness to thousands, of those loving Me and keeping My commands.
and removing the punctuation and pointless phrases, we end up with:20 4-6 `Thou dost not make to thyself a graven image or any likeness bow not thyself to them nor serve them.
Note that the prohibition was on making them for your own use. - It may be assumed that someone else could make them for general use. Pre-Yahweh, Middle-Eastern religions depicted their gods as creatures/ humans/etc. Yahweh himself, thus made himself non-reproducible. He was the image in your mind and nowhere else.
There was a Roman (and I think a Greek) idea that to create something perfectly was blasphemy as only the gods could do that. To create an image of a god was therefore to create an imperfect image, which was insulting
There was a secondary belief amongst many primitive tribes that "the word or the image is the thing itself and/or will cause it to appear
. This would mean causing God to appear - which was just to dangerous. This latter idea relates to even earlier beliefs to "sympathetic magic
So the first prohibition was to prevent any "sympathetic magic" (i.e. only God can do magic, not you. You pray to him and he grants you the power, thus showing why he is worthy of being prayed to) and the second to kill off competing religions.
The NT also speaks against idols 1 John 5:21 "Little children, keep yourselves from idols."
and Acts 15:19-20
19 Therefore my judgment is that we should not trouble those of the Gentiles who turn to God, 20 but should write to them to abstain from the things polluted by idols,
(English Standard Version (ESV))
As it happens, Early Christians saw the Commandment as only concerning depictions of other gods, etc., and only where the depiction of those other gods was made for the purpose of worship (Hence later paintings and statues of Greek gods.)