Not enough power, in the batteries that is...
iFixit rules! The step by step breakdown gives anyone the confidence to put their favorite little device on the operating table with the knowledge that it will wake up 20 minutes later as healthy as the day you met. What more could you ask for?! It's a great feeling of satisfaction to fix anything, and also quite interesting to see how these little "magic slabs" of battery, glass, and chips are put together. I highly recommend the entire experience!
Follow the instructions - you really can't go wrong. If you're not the careful type, well, be careful when removing the front of the iPhone 3g... there are a few things holding the two halves together that could easily be damaged if one were to yank the pieces apart. Use a suction cup, go slowly, and you'll be thrilled at the endless life of your new battery!
iPhone 3G Replacement Battery
iPhone 4 Replacement Battery