APEX is a programming language that allows developers to add complex business logic.
Progammatic logic completes the declarative (at the click) logic that is very extensive on Salesforce. Among other things, APEX can perform complex validations on multiple objects, create business processes that are not feasible with standard tools, integrate an external system with a call to an external Web service.
NB: The APEX syntax is similar to JAVA
Example: An APEX trigger can be executed when a user attempts to delete a record. The trigger checks whether the record has associated records and warns or blocks the user when attempting to delete.