The export tries to pack as many non-overlapping tiles into as few png's as possible, with the exception of animations and additive layers.
Sometimes this gives good results, sometimes it ends up all messy when something from layer2 partially overlaps layer1. (Or when layer2 contains a lot of overlapping tiles)