It depends of which books (or games/fils) you're talking about. In Warhammer the Dwarves have guns, but do they in anything else? Guns are costly and take time to reload. If we're talking about elven archers they could fire through the eyeholes of the dwarven helmets. A volley of arrows is more terrifying than any other chance of missile because if well aimed (not too difficult) there is a 1/1 chance of hitting. Also because it is just a massive cloud of three foot shafts tipped by two inches of steel shot from a 120 pound bow. There'd be a few hundred archers, this making a lot of fire-power. No need for magic here. At close range the arrows would pierce armor. Enchanted armor? -> enchanted arrows. Crossbows only have a good efficiency at close range and take longer to reload. The elves use bows until the enemy is near, then go in with sabers and spears, reducing the risk of death by camouflaging. Elves are also great riders, which is something dwarves don't do. Holding with the beautifully built/architectured elven city, inhabited by beautiful, graceful people.