To redock, the double-click on the titlebar usually works.

You can also stack the windows (one
above the other). Just drag over there until a 'space' opens up and drop it.


You can Overlay (creates a TAB for each). This is a bit tricky to get working. Rpeat tries might be needed.
start with the previous (stack). Now drag one of the windows to the exact vertical center of the other, and Drop