REST in its most simple definition is an architectural style that tries to solve machine to machine interaction problem. We always had the need to simply create programs that its main users are another programs. In ancient times we did this using soap protocol, RPC etc. At some point in time, a smart guy named Roy Fielding had the idea to take inspiration from a platform that solved a much harder problem: machine to human interaction. Which is, the web. It is one of the greatest successes in the history. If some guy had been charging a nickel anytime someone has visited a web page, he would be the richest man ever. So it's a good place to look for inspiration.
The Web solves the very same problems but under much harder context. Which are searching, combining, transforming data, caching, authentication providing good user experience, loose coupling, all in a distributed manner. So, It was a definitely good candidate to use in machine-to-machine interaction as well. It works on a couple of architectural foundations. So the first order of business is determining those foundations. Here's a good sum up. It thinks in resources. It then universally identifies and accesses to said resources. Those resources may have many representations. Those representations use hypermedia to point other resources. And all of that works on HTTP.
All these are there to provide a general purpose system that has flexibility, discoverability, and predictability.
There aren't any tightly coupled rigid contracts in web communication. As in we don't need a specification document to consume a page in Facebook. But all of it works gracefully because of these 3 core values are respected.
Big idea about rest is, what if we exposed the entities in our domain model as web resources and let other programs consumed those resources? Would it work? Well at this point of time where there are nothing but RESTful services we know that it worked.
Going after for those core values of flexibility, discoverability and predictability may be rather vague and obscure task for some people. But luckily another smart guy named Leonard Richardson developed a maturity model that lets us follow a couple of more strict guidelines to reach that glory fo REST. It is a great starting point for anyone wants to develop RESTful web services.