What is an API and How an API works?

What is an API and How an API works?