Boolean modifier (difference) not staying with part
You have to options:

You can parent the cubes. Select the child cube first, then the parent cube last. The parent is the one with the boolean modifier. (Selection color should be orange, the child's selection color should be red. Then you have the correct order.). The press Ctrl+P and select Object to parent them. With Alt+P you can clear the parent relationship again.

Note: In the outliner, the child cube will be attached to the parent cube. You need to expand the hierarchy nodes to see and select the child cube. If you move a cube to another collection, the other cube will not be moved automatically but must be moved manually to the new collection.

Or you can apply the Boolean modifier in the modifier's tab. Then the changes of the mesh become permanent (destructive). The apply button is hidden in the drop-down menu for the modifier in Blender 2.9, it's right next to the modifier's name.