I'm sure someone will chime in with a more detailed explanation, but basically you're dealing with two things, sensor size and lens coverage. Lenses marked with "EF" will work on any Canon camera, while lenses marked "EF-S" will only work on the likes of the 7D/40D.
A bit of a history lesson- Every Canon camera ever made since 29 years ago uses the EOS mount (EF), which was designed for 35mm film, which in turn had the same physical dimensions of modern full-frame sensors (36x24mm). When digital sensors first came along, building a sensor of the same size as 35mm film was difficult and cost prohibitive, and so APS-C was born (23x15mm).
The smaller sensors changed the way certain lenses were used since the field of view was reduced, for instance a 24mm no longer gave you a view that was nearly as wide, thus a lens like the 24-70mm lost some of it's value if you used to use it at 24mm a lot on film. To counter this, Canon designed lenses specifically for the smaller sensors (EF-S), but they still use the same physical EOS mount. A 17-55mm zoom used on an APS-C sensor would be similar to a 24-70mm in terms of field of view on full format, and so photographers got back their wide-angle capability. Additionally, since the sensor is smaller, the EF-S lenses could be designed to cover a smaller surface and be smaller/cheaper themselves as a result, but also making them unusable on cameras with larger sensors.
So you can use lenses that are intended for full format on a camera with any size of sensor, but lenses specifically made for APS-C (EF-S) can only be used on cameras with reduced size sensors, but not the rare APS-H variant that used to exist as part of the 1D line of cameras.