A Web Service is a code that is exposed over the network and can be invoked using HTTP.
Using web service your functionality can be exposed to rest of the world. Web service uses SOAP to transport data. It is a open protocol. With web service the functionality can be consumed from different platforms. For example you can create a web service in your windows computer and that can be consumed from your android mobile.
Using web service you can create a loosely coupled client server environment. Which means, when the server code is changed it is not always necessary to change the client code.