<p>How does reverse proxy server work? Is it used to secure the main server? Is it used as a firewall? What are the reasons for using a proxy server? Could someone give a real world example?</p>

Typically a normal proxy server looks at requests going from an internal network out to the internet and caches them so that if another client requests the same page, the proxy can give it to them much quicker than a brand new request to a remote server.
A reverse proxy works in the opposite way.
Generally a reverse proxy will be installed in front of a web server, so that the second time a client requests a page from that server, the proxy will give it back to the remote client without bothering the web server at all.
In many cases the reverse proxy and the web server are the same machine.  This is often done because the work the reverse proxy does is much, much simpler than going through a complete web server transaction.
Apache, lighthttpd and many other web servers can also function as reverse proxies.
Check
Wikipedia
for more info.