What is an API and How it works?

What is an API and How it works?