How do the MacBook and the MacBook Pro compare performance-wise to an old model iMac? I'm thinking of purchasing either a MacBook (2015, 1,1 GHz) or a MacBook Pro (2015, 13-inch Retina, 2,7 GHz).

I'd like to know how they would compare performance-wise (say, speed on recalculating a huge spreadsheet file) with my current iMac (27-inch, Late 2009, 3.06 GHz).

I'm assuming it is not just about those GHzs, or is it??
Despite what Weird Al would have you believe, it is no longer "All about the Pentiums" (jury is out regarding whether the 'Benjamins' are still a relevant unit of currency). 

The answer depends very heavily on the exact specs of each system, but I would expect you to notice better performance out of the laptops for a few reasons:

The Core i series all support hyperthreading, which will make the dual core processors act like they have 4 cores. I forget which versions of the Core 2s have that available, but neither of my Core 2 duo laptops support it, so I'll be spiteful and assume yours doesn't either (feel free to prove me wrong). 

The next question is how big your large spreadsheet is. The larger cache on the Core i will mean that spreadsheets approaching the 5-megabyte range will process appreciably quicker. 

To build on the theme of low-latency data access, I believe that all Core 2 CPUs use DDR2 memory, while the MacBooks will use DDR3, so you'll feel faster start up times and have an easier time using multiple applications or spreadsheets. 

The last piece to consider is the longer instruction pipeline means that the Core i series can do much more with each "tick" of the processor. 

All in, you'll likely feel an increase in speed and peppy-ness over your iMac with a newer MacBook (though the MacBooks won't quite keep up with a new iMac). That all being said, I'm just some random guy on the internet who copy/pasted some Wikipedia links. Go to an Apple Store and try one for yourself to see if it's actually worth the money to upgrade!

Edit:

For July of 2015, the relevant processors' passmark scores are:


2009 27" iMac (T7300) with 1201
2015 13" MacBook Pro (5257U) with 4608
2015 12" MacBook (5Y31) with 2484


To answer the original question, from a purely CPU-based perspective there is an appreciable increase in performance, though it may be worth noting the value-based scores passmark gives, where the MacBook with the 5257U trounces the other two options.