I think the two biggest problems in the AI falling behind inresources is that is just awful in deciding how to use a planet, like Eisenhans said and has been wailed over in so many Posts you can't count them in a lifetime.

The second is that it lets alot resources go to waste as overhead which a human will (hopefully) not let happen if at all possible. Most players use resources they can't store to build units without upkeep on planets that already have their full complement of facilities. At least I do. But since the AI sometimes doesn't even build anything at all for several turns it's bound to lag behind.