The difference between iniquity and sin is that the former refers to the unfairness or unjustness of a person's wrong actions while the latter is all about the actual wrong actions. Iniquity comes from the word "inequity" or "unequal."
During the olden days, people used the word "iniquity" to refer to unjust dealings with other people. Nowadays, the word "iniquity" refers to "a wicked act or thing; sin," according to Merriam-Webster dictionary. An example that clearly shows there is a difference between iniquity and sin is Psalm 38:18: "For I will declare mine iniquity; I will be sorry for my sin." Another example is part of Psalm 32:5, where David said, "the iniquity of my sin."