Why two objects behave like one?
You added the new cube while still in Edit Mode.
So both meshes are now part of one object - as shown in the Outliner.

You can easily split them into separate objects through
Mesh > Separate > By Loose Parts