It works more or less similar to axis2 archive file (.aar) and class-loading is very similar (ie:- loads classes from top level of the archive or from .jar files located in /lib ).. However each time a mediation library archive is deployed it will load (ie:- lazy loading) the content in to memory, construct class-loading , etc . And only after users explicitly import (ie:- through <import ..> synapse construct ) the library package , would synapse load its artifacts and made available to its users at runtime...
More information on this can be found in docs/userguide/template_library.html . Also set of samples can be found in samples catalog -- samples 850 - 857
If you want to test above samples EIP core library will be located in "modules/core/target/library_repos/synapse-eipcore-lib.zip" and copy the file into synapse distribution "repository/conf/synapse-libs" path..