From the javadoc:
causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.
So it maeks your thread block / wait until the process/program you opened ends.
Javadoc is your friend.
Hth
Lima