Which one is faster? iMac 27 with Quad Core i5 2.7GHz or a Macbook Pro 15 with Quad Core i7 2GHz? They are about the same price ($100 difference, iMac $1699, Macbook Pro $1799), and

iMac: Quad Core i5 2.7GHz
Macbook Pro: Quad Core i7 2.0GHz

How can you tell which processor is faster?

(the iMac shows 4 processors in the Activity Monitor, while the Macbook Pro shows 8 processors)
They are the same, or the i5 would be infinitesimally faster, which would translate into no real world difference (certainly none above perceptual thresholds).

This article compared the i5 750 (2.66 GHz clockspeed) vs. the i7 860 (2.8 GHz clockspeed). Data shows the i7 inched ahead by an average of a 3% performance improvement on the whole. Make note that this is a lopsided comparison in favour of the i7 (if only marginally). The Macs you list would favour the heavier clockspeed on the i5. The i7 has hyperthreading (hence seeing the 8 cores) but that doesn't do enough to give it a substantial lead.

The article also shows the i5 outperforming the i7 in power consumption, which should be a deciding factor when buying a notebook.

But at the end of the day, you are comparing a notebook with a desktop, so it's a little lopsided. The iMac has a much better video card and a larger screen with a higher resolution. There is much more to a system than the CPU. On a whole, the iMac is a faster (better) machine, but not portable.