Skill level increases the speed of mining and also increases the chance of leaving behind stone, ore or gems depending on the material mined. At Legendary skill, a miner will always leave stone/ore/gems behind. High skill can actually be undesirable, since excess stone can be a nuisance. However, miners gain skill extremely quickly so some amount of stone is unavoidable. Miners are required to dig tunnels, channels, stairs, and ramps, as well as remove said stairs and ramps. Miners require a pick to do any work.
In order to start digging you need to designate an area to be dug. This is done with the Designations menu.
Currently, the only way to prevent miners from mining a certain area is to prevent them from finding their way to that area. Locking them on the other side of a door or hatch, or if separate from your main fortress, using the "No dwarves outside" order are two possible solutions.
The mining skill is unique in that it is the only civilian skill that can be used in combat. Because miners quickly improve their mining skill during the normal course of mining, and because they always carry their picks with them, miners are extremely useful for defense in the early stages of the game. Woodcutters also carry their axes with them at all times, but axes use a special combat skill that is not practiced while doing civilian work. Miners will use their picks as weapons if they are drafted while they are carrying picks, and they are not designated to use any other weapon (i.e., they are instructed to fight unarmed). Picks make better weapons than one might expect - basically, they are spears that do 30% less damage. During this combat, a miner gains mining skill.
 Mining behaviour
If a large area is designated for mining, miners will all tend to clear out the left side first, working from the top down as much as possible. This is not an absolute, but a strong tendency.
Once mining, a dwarf will automatically continue on to mine any connected tiles (on the same level) designated for mining, even diagonally, rather than shift to mine a discontinuous tile.
Dwarves do not tend to see tiles on different levels as "connected" (for instance, an up-stair below a down-stair), and will tend to clear one level before moving on to another, even to the point of moving far across a map to do so. They seem to mine top levels over lower ones.
If no mining-designated tile is connected, they will then shift, seeking to mine a top-left designated tile on a top-most level.