Nearly every decent web site and application will have an application programming interface (API) of some sort. This may simply be another interface into the applications most advanced administrative controls, controls which perhaps are used by only 5% of users and would clutter up even the most clearly designed user interfaces. To make those controls open to end users, they have traditionally been exposed in a programmatic manner, that only deep technologists would look at or need to use. In addition, those API's were probably only ever exposed to private internal networks, where their protection from a security perspective was probably less of a concern.
As more organizations (and consumers of course) leverage applications and services online, there is an increasing percentage of web based API's. A quick book search on Amazon produces over 200 results with regards to their design. Undergraduate computer science courses will often have a module on basic web programming, with the simplest examples now choosing to build out an API instead of a full blown user interface driven application. Many consumer focused applications and social networking sites such as Twitter, Google and Facebook, all lean heavily towards API level features.
Why They're Popular
For the likes of the consumer focused social networking platforms, API's provide a powerful tool to promote developer adoption. Increased developer adoption for the likes of Facebook, increase the attractiveness of the service being offered, especially if more versions of Angry Birds or Candy Crush are being released. API's in this framework, are all about certain features and ease of use. The premise is focused on being able to expand and extend the underlying platform as quickly and simply as possible, using a variety of client libraries and languages.
From a more business focused web application, API's are more focused on integration, interoperability and customization. Integration with regards to owned business logic and process, interoperability with regards to underlying system and language differences and customization, perhaps relating to user experience.
Many web services in general could be argued to be solely API driven. Sites like the Google owned VirusTotal, which provides a virus checking aggregation service, can be accessed using a user interface or API. The same could be applied to Google itself
Why They Need Protecting
As web services and applications switch to becoming more engine like in nature, with limited or no user interface at all, the protection of the underlying API becomes more important. The increased popularity of REST as architecture for web API development, provides not only an increased ease of use for developers, but also simpler touch points for the authentication and authorization of endpoint clients. Knowing which clients are accessing your API is critical, as is being able to restrict their access to certain features or URL's.
Like with many security related aspects, externalising the authentication and authorization aspect away from core API feature management, allows developers to focus on core use cases and consumer and business value, without worrying about security.