Lines or connectors between shapes can look connected when they really aren't. If you don't see red feedback when you select a connector, the connection isn't complete.
These shapes look connected because the connector is touching both shapes. But notice that the ends of the connector are green.
When one of the shapes is moved, the connection breaks. The shapes weren't really connected, so the connecting line stays where it was.
When something is really connected, or "glued", the ends of the connector turn red when you select the connector.
When one of the shapes is moved, the connector stays attached.
You can tell when something is really connected in a Visio drawing because the ends of the connector appear red when the connector is selected. This red feedback means the connector is "glued" to the shape.
Without the glue, the connection breaks if you move the shape away.
You can draw lines that make shapes look connected, but if those lines aren't actually glued to the shapes, you'll need to reposition both the shapes and the lines each time you rearrange your drawing.