I found this diagram from http://supunk.blogspot.com/2009/07/wso2-esb-high-level-architectural.html?view=sidebar. It is very helpful for me to understand how messages work inside ESB.
An application sends a message to the ESB.
The message is picked up by the ESB transport.
Transport sends the message through a message pipe. Quality of service aspects like Security and reliable messaging of the message is taken care in this pipe. Internally this pipe is the in-flow and out-flow of Axis2. ESB can operate in two modes. Message mediation or proxy services. In case of message mediation a single pipe is used. In case of proxy services we can think of separate pipes connecting transport to different proxy services.
Message transformation + routing can be seen as a single unit. As the diagram specifies there is no clear separation between message transformation components and routing components. WSO2 ESB call this the mediation framework. Some transformations happens before routing decision has taken. Some transformations happens after the the routing decision has taken. This part is the Synapse implementation.
After this message is injected to the separate pipes depending on the destinations. Here again quality of service aspects of the messages is determined.
At the end there is a transport layer. This transport layer takes care of the transport protocol transformations required by the ESB.