The most important factor determining the damage of an asteroid impact is the energy it releases upon impact. This is calculated by multiplying half the asteroid's mass by the square of its velocity. The typical range of asteroid velocities is quite limited — most measured values are between 12 and 20 km/sec (7.5 - 12.4 mi/sec). Comets are much faster, ranging between 50 and 70 km/sec (31 - 43.5 mi/sec).
Yet, what asteroids lack in speed, they make up for in density -- while comets are thought to made up of mostly ice, with a density of only 1000 kg/m3, asteroids made of solid rock have a density of about 3000 kg/m3, whereas the rarer (8%) metallic asteroids have a density of 8000 kg/m3. These density values intimately effect the final consequences of the asteroid impact.
Other factors influencing the environmental effects of an asteroid impact include its size (obviously), angle of impact (the most probable is 45 degrees), and impact surface (water, silicate rock, or crystalline rock). The size of asteroids is distributed along a power law, where asteroids above a certain size are exponentially rarer than smaller ones.
Asteroids about a meter in diameter are thought to enter the Earth's atmosphere about once every month, leaving 100 ft (30 m) craters in their wake. Asteroids a kilometer in diameter impact only once every million years or so, releasing as much as 100 gigatons of TNT, 200 times stronger than the most powerful nuclear weapon ever tested. Such an impact would shatter glass windows as far as 500 km away, leaving a 20 km (12 mi) crater. The largest asteroid impact in the last 4 billion years is thought to be the asteroid which created the Vredefort crater in South Africa, with a diameter of about 20 km (12 mi).
Large asteroids do their damage in one of three ways: the initial air blast and thermal wave, which can be strong enough to incinerate forests; the ejecta, which can bathe continent-size areas in magma, and the blocking out of the Sun due to soot particles in the upper atmosphere. The last factor is most terminal for life, as without photosynthesis, food chains collapse, and only decomposers and scavengers would be able to survive for more than a decade. In the case of impacts with asteroids over 20 km (12 mi) in diameter, scientists believe that all complex life (including all animals and higher plants) would be wiped out, leaving nothing but microbes, similar to the situation on Earth around a billion years ago.