The underlying cause is misalignment of the insects compound eye relative to the sensor grid. That's it. Nailing focus certainly makes it more obvious but most processing software recognizes chromatic aberration and moire as problems and correct for them with varying degrees of success
Here is what Nikon has to say about it.