Can you also do this when you move to a smaller sized hdd?
From a 500gb 7200 to a 256 SSD for example?
what do these programs do with the extra space that doesn't fit on the new drive?
yes, you can also migrate to a smaller drive, of course provided that there is not too much data on the old drive that wouldn't fit onto the new one.
I have done this procedure quite a number of times successfully, be more my own old PB G4, or some of my friends' MacBook Pro's.
The procedure is in essence the same like OrangeSVTguy explained above:
1. put the new drive into an external case and connect it to your Macbook
2. format the new drive (GUID table is needed for intel-based laptops)
3. copy your entire old drive contents to the new one (I use the xupport.ch tool)
4. choose the (still externally connected) new drive as new startup disk
5. boot your Macbook from the external new drive
6. check whether everything works fine based on the new drive
7. exchange the old internal drive with the new drive
8. check again by starting up from the new (now internal) drive
9. put the old drive into the external drive case so you can use the old drive as an external data storage
On step 3, be sure to check in Xupport tool the option "startup disk". Otherwise it may not work.
Cheers, RAPHAEL