For example if you use JMS, a unique message-filter is used which guarantees that it will wait for that specific reply message and nothing else.
I like to say that the message that is returned to the client (the one using ServiceInvoker.deliverSync) is the last non-null Message from the last successfully executed action in the action chain/pipeline.
If there is an exception in the action chain then the exception makes it all the way back to the client.
Note: I've not tested what returning null does to the SI client. Perhaps null makes it all the way back to the client. Plus I've not fully tested what is returned should the timer expire. I'm guessing the returned message is null.