Merging 2 objects, no loose parts
We can avoid the separation of the two objects after hitting the Separate by loose parts in these steps:


Merge the two objects with Ctrl + J
Go to Edit Mode and select 2 vertices, one belongs to the first object and the second belongs to the second object
Merge the vertices with Alt + M