iMac is a consumer desktop, Macbook Pro is a professional laptop, you aren't comparing the same things.
You might want to take a look at the specs. The iMac and MBP are basically the same. Yes, one is a consumer desktop and the other is a pro notebook, but that doesn't change the fact that they're essentially the same inside. The 24" iMac is definitely a faster system than the 17" MBP is for example.