-I hav a simple rifle with great accuracy (like 7) and low to-hit (-30), and another one with low accuracy (2) and good to-hit (+20). which one is more accurate? Or not so dramatic examples, like one gun with 5 accuracy and +5 to-hit and another one with 4 accuracy and +15 to-hit.

I know what Accuracy means, but what exactly to-hit chances and how much?

I did some tests in the game with different weapons with the same range and to-hit but different accuracy (1 and 2). Accuracy dont make any difference on the F hotkey, same chances. Also made no difference in Aimed Shot.

So... Now I know what To-hit changes, it does what I thought accuracy does! So what the hell accuracy do!?

This is all explained in one of the HAM4 threads, but basically nAccuracy is used to generate bullet deviation. The higher your nAccuracy value, the less bullet deviation you'll get which results in a smaller shooting aperture. But don't confuse bAccuracy and nAccuracy.
bAccuracy is exclusive to OCTH and has a range of something like -2 - +12. bAccuracy is, as Off_Topic said, simply added to the OCTH calculation.
nAccuracy is exclusive to NCTH and has a range of 1-100. And because of how the calculation works, lower numbers have smaller differences then higher number. In other words, the difference between nAccuracy 1 and 2 is basically negligable. While the difference between 98 and 99 is pretty extreme.

nAccuracy has absolutely no impact on the displayed "Muzzle Stability" value (F hotkey). That hotkey ONLY displays the mercs ability to hold the weapon steady for the shot in question, and is only one part of the entire NCTH hit chance calculation. nAccuracy (along with range and scopes/lasers) is displayed in the size of the shooting aperture (the smaller of the two circles on the NCTH cursor). Lower nAccuracy values will result in larger shooting apertures; higher nAccuracy values will result in smaller shooting apertures. That said, the shooting aperture is generated using alot of different variables, nAccuracy being just one small part. To test my statement, you'd have to use two weapons with otherwise identical states, identical attachments, with the same range and terrain seperating he shooter and the target. Probably the best way to do this would be to load your game and take a screen shot with a merc preparing a shot with a specific weapon at a specific target. Instead of having the merc take the shot, though, close the program after making the screen shot and edit your weapons.xml file so that the mercs weapon has a drastically different nAccuracy value. Then load back into the game and take a seperate screen shot under the same conditions. Compare the two screen shots and (depending on how much you altered the nAccuracy value by) you should see the contrast.

This is all explained in one of the HAM4 threads, but basically nAccuracy is used to generate bullet deviation. The higher your nAccuracy value, the less bullet deviation you'll get which results in a smaller shooting aperture. But don't confuse bAccuracy and nAccuracy.
bAccuracy is exclusive to OCTH and has a range of something like -2 - +12. bAccuracy is, as Off_Topic said, simply added to the OCTH calculation.
nAccuracy is exclusive to NCTH and has a range of 1-100. And because of how the calculation works, lower numbers have smaller differences then higher number. In other words, the difference between nAccuracy 1 and 2 is basically negligable. While the difference between 98 and 99 is pretty extreme.

nAccuracy has absolutely no impact on the displayed "Muzzle Stability" value (F hotkey). That hotkey ONLY displays the mercs ability to hold the weapon steady for the shot in question, and is only one part of the entire NCTH hit chance calculation. nAccuracy (along with range and scopes/lasers) is displayed in the size of the shooting aperture (the smaller of the two circles on the NCTH cursor). Lower nAccuracy values will result in larger shooting apertures; higher nAccuracy values will result in smaller shooting apertures. That said, the shooting aperture is generated using alot of different variables, nAccuracy being just one small part. To test my statement, you'd have to use two weapons with otherwise identical states, identical attachments, with the same range and terrain seperating he shooter and the target. Probably the best way to do this would be to load your game and take a screen shot with a merc preparing a shot with a specific weapon at a specific target. Instead of having the merc take the shot, though, close the program after making the screen shot and edit your weapons.xml file so that the mercs weapon has a drastically different nAccuracy value. Then load back into the game and take a seperate screen shot under the same conditions. Compare the two screen shots and (depending on how much you altered the nAccuracy value by) you should see the contrast.