Everything circling the sun does it in a particular plane. Earth's plane is called the "Plane of the Ecliptic." Most planets and asteroids have planes which make only small angles with the Plane of the Ecliptic, but small doesn't mean 0. Every asteroid orbit crosses the Plane of the Ecliptic at precisely 2 points.
In order to be a threat to Earth, an asteroid must:
Have it's closest approach to the Sun, perihelion, within Earth's orbit. (And it's farthest distance, aphelion, outside, but all the known asteroids do.) Its orbit must also intersect the Plane of the Ecliptic somewhere near the point that its distance from the Sun is the same as Earth's distance from the Sun. Otherwise, it will pass "north" or "south" of the Earth.
(I'm taking the orbit as an ellipse drawn by the center of mass of the orbiting body, whether asteroid or Earth. Thus, the lines don't have to actually intersect, but the centers of mass have to come close. 4,000 miles would make a collision, but the simplification of the asteroid only being gravitated by the Sun becomes ridiculous somewhat farther out. If the orbital course looks like it will pass within 5,000 miles of the Earth's center of gravity, there will be a collision.)
"Somewhere near" is deliberately vague. To bring the two orbiting bodies close enough for a collision, the distance in linear measure must be small. That means that the sine of the angle between the 2 planes times the distance from the intersection point must be below a threshold.
Consequences after the jump.
Keplerian simplification
If we treat the orbits of Earth and the asteroid in the purely Keplerian fashion, ellipses with the Sun at one focus, then the calculated probability of collision in our future is essentially 0.
Take the point of closest approach of the 2 orbits. Take a circle representing time in terms of Earth orbits. Mark every time that the asteroid passes through that closest approach on the circle. If the ratio between the periods of Earth and the asteroid are a rational number (this is probability 0), then the marks will repeat after a while. If the ratio is irrational, then the marks begin to fill up the circle and, after a while, one is very close to an earlier one. As time goes on, the pattern provides a set of dotted lines, with each dotted line having some small, regular distance between the dots.
Take that to 10,000,000 -- to 100,000,000 -- repetitions. The dots must be incredibly close for there to be any substantial gap between the sections of dotted lines. To bring this from the diagrammatic to the physical, that an asteroid had an orbit for 100,000,000 years which could possibly collide with Earth, it would already have done so.
The problem is that orbits aren't quite Keplerian. The Sun isn't the only body influencing by gravitation. (Indeed every body in the universe, including dust motes in the Andromeda Galaxy affects the orbit of the asteroid. Most of them don't affect it appreciably.) In particular, there are 2 influences which make "dinosaur killer" asteroids possible.
1) Other planets, notably Mars and Jupiter, can gravitationaly affect an asteroid to send it much closer to the Sun than its former orbit. So an asteroid innocently circling in the asteroid belt between the orbits of Mars and Jupiter can suddenly have its orbit altered to be a bother to us.
2) Once in an orbit with its perihelion close to an astronomical unit, the asteroid comes close enough to Earth to have its orbit altered appreciably on a regular basis. Each time, its chance of future collision is changed slightly -- not necessarily increased, but changed.
It should be noted that when an impulse -- a change in momentum at a single point in time -- is given to an orbiting body, the new orbit passes through the point in space where the change takes place. Real change is acceleration, something which takes place over time. Nevertheless, to the extent that the change takes place in a segment of space, the new orbit passes through that segment of space.
Ideal prevention
Assuming we get enough technology to actually change asteroid orbits, what change would be best? Well, I'm assuming that simply delaying the collision wouldn't be acceptable. That means we don't want the asteroid's new orbit to come within the danger zone of Earth's orbit, since -- sooner or later -- both bodies will pass through the danger zone simultaneously if it exists. I see two alternatives:
1) At the asteroid's aphelion, give it sufficient impulse in the "eastward" direction to increase its perihelion to more than one astronomical unit.
2) Roughly 1/4 of the way around the asteroid's orbit from the point where it's plane intersects the Plane of the Ecliptic, give it sufficient impulse in the "northward" (or "southward") direction to move that intersection point far away from the Earth's orbit. (We have to avoid putting the other intersection point close to the Earth's orbit, but this is a matter of calculation at the time. It is unlikely to be a serious problem.)
I believe that #2 would usually be easier, but this is something to calculate in each particular case. Then too, "easier" depends on more than the size of the needed impulse.
Industrial accidents
There have been worries about asteroid mining. If it happens, what is the likelihood of something going wrong and bringing a deadly weight falling to Earth from the sky. Before I go into the numbers, may I say that I suspect that these worries come from our natural view of the universe in a pre-Copernican fashion: The Earth is big and central; the sky is something close around the Earth; the natural destination of anything not held up is on the ground. Nobody today thinks that way, but we all, to some degree, feel that way.
(I've read discussions on dKos about a satellite "dropping" weapons down on the Earth's surface. No. If you drop something out of a satellite it goes into orbit. How hard you push it out determines the orbit, but you have to give it a huge push before it goes into an orbit which enters the Earth's atmosphere.)
I see 2 possibilities:
1) The mining operation aims to put a shipment into Earth orbit somewhere like L4 or L5. Such a shipment must be provided with braking rockets -- else it comes near, waves, and goes back out to the same distance from the Sun as when it started. Okay, they aim wrong, and it heads directly towards Earth; whatever handles the braking rockets also goes wrong, so that the shipment can't be diverted.
Now the radius of Earth is 4,000 miles, and the Moon (and consequently L5) is 240,000 miles away. So the error has to be in the right (or, really, wrong) direction and by very precisely the right amount. An error of 3% more or 3% less will miss the Earth. (And I'm imagining that the error is all in the correct plane.) And the guidance has to fail at the same time. We're dealing with a situation where the mining shipments can have neither error in direction nor failure in guidance very often. Else their products won't be available for sale.
2) Some other mishap sends something Earthward. This is not only less likely, it is unimaginable. The impulse needed to get something from outside the orbit of Mars close enough to the Sun to intersect Earth is tremendously difficult to generate. I can imagine creating a new technology capable of generating it deliberately. (And we would have to have a new technology. Getting to the asteroids from Earth orbit is within our present powers. Taking along enough fuel to change orbit to match an asteroid's when we get there is foreseeable, if not within present capacity. Taking along enough fuel thorough those maneuvers to return is far beyond what we can do today.) I can't imagine any way that that much energy is generated by accident -- much less generated in precisely the right direction.
Disintegration danger
A good deal has been written about disintegrating a killer asteroid. "Then you'd have craters all over the Earth. It would be worse."
If you disintegrated one just before collision, yes. But that doesn't mean that disintegration is a danger always to be avoided. I go back to the truism that any resulting orbit passes through the point at which the change occurred. If you disintegrated an asteroid, then the result would be a large number of pieces, each in its own orbit. (Assuming that the force of disintegration would be stronger than the self-gravitation of the asteroid.) Each piece would have an orbit which would pass through the point in space where the disintegration occurred. They would not pass through at the same time. (I'm assuming something like an explosion which would give each piece a significant velocity relative to the center of gravity of the entire asteroid.) Assuming that:
1) The disintegration occurred at a point sufficiently far from the intersection of the asteroid's orbit with the Plane of the Ecliptic, and
2) That the resulting velocities with respect to the center of gravity of the asteroid are randomly distributed,
Then only a small fraction of the pieces would have orbits which intersected the orbit of Earth. If the pieces were small enough, the result might be the institution of another predictable meteor shower.