As I said earlier forget about the POJOs, if your session bean calls code in a Java class then the code is executed as if the code has been typed in the method of the session bean.
POJO is a buzzword that is used all over the place when talking about persistence and aspect oriented programming but when you are running within the container it is irrelevent for JNDI lookups.
The 'java:' namespace in JNDI is an area that holds references to items only available from within the application server.
The 'java:comp' namespace is for a specific component, each EJB will have its own. The only way to get items into this namespace is by adding <ejb-ref> and <ejb-local-ref> elements to the deployment descritptors.
Names without the prefixes are in the global namespace, this is accessible from within the app server and from the outside. All components are automatically bound to the global namespace unless you configure otherwise.
Q - Why does the following work?
A - Because the component is bound to the global namespace on deployment.
I am not sure if I understand your last question, when looking at the code performing lookups it is either running within a component deployed within the app server or it is a stand alone application running in its own JVM instance outside the application server.
To see what is bound to JNDI: -
Click on 'JNDI View'
Click on the button for the 'list' operation
The page that is displayed next shows you what is currently bound to the different namespaces.
All right !