Shooting isn't simply a matter of pointing your weapon at the target and letting fly. Factors other than your Ballistic Skill affect the chance of hitting, such as range and cover as already discussed. There are other factors too, some of which make it easier to hit and others that make it harder. These are called To Hit modifiers, and they are cumulative.
Factors that make it easier are added to your dice roll. Factors that make it harder are subtracted from your dice roll.
All shooting to hit modifiers are cumulative. So, if you are shooting at long range at a target behind soft cover, your chance of hitting is reduced by -2. This means that with BS 5 you would need to roll a 4 to hit instead of the 2 normally required.
For example: Ten Goblin Archers fire at a unit of Elves. Their targets are 10" away. To make matters worse, the Elves are standing behind a hedge - soft cover! The Goblins are armed with short bows, so their targets are at long range (short range for these weapons is 8" or less). Because their BS is 3, the Goblins need 4s to hit, but since their targets are in cover and at long range, they suffer a penalty of -2. So each archer needs to roll a 6 to hit (6-2=4). The_player rolls ten dice and manages to get two 6s - two hits!
+1 Shooting at a Large Target
A large target is anything which in real life would be massively tall or which is especially bulky. Giants are large targets, for example, while Men, Orcs, Elves, Ogres, Cannons and the vast majority of troops are not. In every case, a creature's description in the relevant Army book will inform you whether it is a large target or not. Cavalry riders are not considered to be large targets if they are riding horses, wolves, boars or comparable beasts. Dragons, Greater Daemons and certain war machines are large targets.
-1 Shooting While Moving
If the shooter moved during the Movement phase (or during the Magic phase via the effect of a spell) then his chance of hitting is reduced. Even a simple turn or change of formation is enough to reduce his concentration and so counts as movement for this purpose.
-1 Shooting at a Charging Enemy
If a model is charged and elects to stand & shoot at his attacker than his chance of hitting is reduced. While the enemy thunders towards him, his aim will be distracted and his hot hurried as he abandons his weapon to take up a sword.
-1 Shooting at Long Range
If the target lies at over half your maximum range you are less likely to hit. Sometimes you will find some of the shooters are within short range and some are ar long range. If this is the case, you muse roll two batches of dice, one for each range band.
-1 Shooting at a Single Model or at Skirmishers
If the target is a single man-sized model (including characters) on foot then this penalty applies. The penalty also applies when shooting at enemy in a skirmish formation or at any single man-sized model on its own. See the section on Heroes and Wizards for a complete explanation of the rules for shooting at character models, and see the section on Skirmishers for rules regarding skirmishing troops.
-1 Target is Behind Soft Cover
If the target is behind soft cover then the chance of hitting it is reduced.
-2 Target is Behind Hard Cover
If the target is behind hard cover, the chance of hurting it is drastically reduced.