We don't pass the config object - The container (server ) passes it.
When the servlet is loaded the container calls the init method of the servlet and passes an implementation of servletconfig as a parameter. The container would have read init-parameters etc specified in the web.xml into the servletconfig object, so that in the servlet once you get hold of the config object, you can make use of that data.