Commandments and sins are always two sides of existence, with commandments on the side of holiness and sins on the side of impurity.
This may be compared to the difference in value be- tween positive and negative numbers.
The difference is quintessential.
One set is on the positive side of the zero, the other set on the negative.
The smallest of the positive numbers is larger than the largest of the negative numbers.
If a person performs a commandment, even by accident, it is still a commandment.
When he refrains from committing a sin, even by accident, he is still refraining from sin.
The difference between this person and a person who acts with intention is only a question of magnitude.
Rabbi Adin Steinsaltz