A RESTful API is an acronym for Representational State Transfer. REST is an architectural style which defines a set of architectural constraints for stateless communication between Application Programming Interfaces, or APIs. It is not a standard, so it allows developers some flexibility, but it acts as a mediator between users, clients, and resources. Then SOAP vs REST, what is the main difference? REST has become ubiquitous in API programming because it emphasizes scalability and greater interoperability, while its predecessor SOAP was a highly-structured protocol that required XML.
REST offers a number of constraints that make life easier for developers while still providing functionality and security.
At the heart of RESTful APIs is the contract between client and server. This contract defines what the API will do and what kind of requests and responses it will issue. In some ways it is the machine and human readable documentation of the API. If you call the API, you must do so in a way that it understands, and you must be able to accept its responses, also. An example of an API contract can be seen here. You can see the APIs URLs, verbs, HTTP responses, and contract statuses- all the rules of interacting with this API are defined in the contract.
For more on contracts, check out the Open API spec.
RESTful APIs solved a lot of problems from the early days of the internet, and contributed to the explosion in web and cloud-native development. They offer uniform interfaces, security by authentication, and statelessness to developers looking to solve problems quickly.