The OS can have a massive impact on battery life though, look at WinMo, it could last days when the likes of Android and iOS at the same time, couldn't even make it through a day. My phone has bigger than an iPhone 3G (although has a very slightly larger battery capacity) and yet when people were struggling to get a day without the 3G needing charging, I was reguarly getting 3 days+ on WinMo 6.1 (and 6.5 whilst I was running it) with SBP Home Shell.
iOS 4 improved battery life performance later in life for the 3G, simarly when iOS 5 was released, the battery life supposedly improved on the iPhone 4.
A similar scenario happened with Android, Froyo was terrible for battery life in comparison to Gingerbread. Whilst at the time I was getting 2-3 days on WinMo, Froyo final was giving me about 6 - 12 hours with no more usage than normal... same phone, different OS's, so there is something in it.
There used to be a chef on XDA-Developers called Jacko who made WinMo 6.1 ROM's without all the fancy stuff added, and with many of the advanced options (that nobody uses) completely removed (Telnet, RDP etc). The ROM's were built for core speed and efficiency, but they also boasted 4+ days of battery life. On a somewhat related point, I also found that if I overclock the CPU in my phone, amazingly I get slightly better (noticeable) battery life than at stock, mainly because the CPU is running more efficiently at full speed, and is still set to underclock as normal when full speed is not required/battery is running low.
I think it's a case of developers being more interested in features and arty-farty stuff initially, and only later realising battery life is important to users as well, a phone is of little use if you have no battery left to power it, no matter how many apps you have.
My phone is now struggling to get a day though, it's over 2 years old now and had a very hard life and the battery is, for want of a better word, shot! It sometimes shows 20% a few minutes after charging, turn it off and back on and it shows 60% or summit, then drains again quickly, then a restart it shows higher again, the last 5-10% always seems to linger like it always did, but I need a new battery lol.
