By better im not wondering about what has more bells and whistles to the camera, i want to know about the final image quality.
No point having the sharpest lens in the world if it can't focus fast enough, right?
While the 40D is a good camera, the 1D mk III is a better camera. It's weather sealed and more rugged so you're able to use it in weather that would make the 40D fail. It's got a better autofocus system so you'll get shots that the 40D will struggle with. The 1D Mk III's shutter is rated at 300,000 actuations while the 40D's shutter is rated at 100,000 shutter actuations. All else being equal, that means that the 1D Mk III will take 3x more photos than the 40D before breaking down. 10 fps vs 6.5 fps is going to be a difference felt by sports and wildlife photographers.
If all you're interested in is taking photos of test charts to determine lens sharpness, or photographing static scenes or peeping at pixels and commenting on "high ISO performance" then the 40D and 1D Mk III will give similar performance. If you're after a camera that will open up more opportunities and give you more keepers, then you'll see the value in the 1D Mk III.
Having said that, the 40D and 50D are very competent cameras. Lots of professional wedding and portraits photographers depend on them.