I am really not able to visualise a 'Context' physically.We set up a resource file, get an instance of Context from ContextFactory and use the context to get an instance of EJB or something. What is this 'Context'?
Contexts are just a generic "lookup" mechanism. They don't necessarily have any physical component.
The JNDI (Java Naming and Directory Interface) API, from which contexts are derived, is used in Java to look up all kinds of things: server resources (including EJBs, datasources and messaging connections), LDAP structures, files in the file systems, CORBA names, etc.
The idea behind JNDI is to match resources (objects) with string ids (the JNDI name) which you can use to retrieve that resource.
Context is nothing just a your object's gateway to interact with placeholder where it loads.
Like in case of EJB it is provides mechanism to interact with container,in case of servlet ServletContext serves same purpose similarly AppletContext behaves.