I am trying to create 2 cubes, with one mirroring the other. Instead it appears to create one cube that is always connected to the center!
Shift A amd create a cube. move it to right along x axis beyond the center line. Make sure 3d cursor is at world origin by pressing shift + s and select cursor to world origin. With your cube still selected in object mode press F3 and search for set origin and select origin to 3d cursor. Select mirror modifier and make sure your axis is x going by your picture