If the objects are reported as the same size in the Transform or Info panels then any variation is due to .....
In both instances the same thing is happening, black is anti-aliased and encroaches upon the white areas. The difference is the viewer's visual focus.
If you visually see the white as a 'foreground" object, then you notice the white getting smaller.
If you visually see the black as the foreground object, then you notice the black getting bigger.
If you do this side by side, then they same objects appear to be slightly different sizes.
And note this is most noticeable when using white because of how Illustrator sees white as "not there" or transparency. Using black and an actual color should not reflect the same visual difference due to anti-aliasing.
- A black object on top of a white object, will anti-alias black to white.
- A white object on top of a black object, will anti-alias black to white.
- A black object on top of a green object, will anti-alias black to green.
- A green object on top of a black object will anti-alias green to black.
Thus making the anti-aliasing similar (in size) and color-relative for both instances. Expanding the black on top by a couple pixels. And expanding the green on top by a couple pixels. Both objects are expanded by an equal amount when white is not one of the colors.
In many cases, a screen with a higher pixel density will reduce the visual prominence of any anti-aliasing, making this tiny variation less noticeable on screen.
When printing commercially, the difference will be so very tiny, you'd need a micrometer to tell the difference. And, in fact, due to dot gain, there may be less variation upon output.
However, if printing on something like an end-user inkjet printer, depending upon the paper being used and how much ink it "soaks up" the dot gain may increase this variation making it more prominent. Using a higher-quality paper for an inkjet would help reduce this variation. This is why some inkjet manufacturers suggest "premium" paper for photographs or higher-quality prints - so less ink is absorbed by the paper. Although, I gotta admit, I don't know anyone measuring object sizes on a physical inkjet print, at least not to the degree it would matter visually.