Apex in Salesforce is a strongly typed object-oriented programming language used to write the code that is executed on the salesforce platform, It is a properietary language developed by salesforce.com, allowing developers to execute flow and transaction control statements on Salesforce servers in conjunction with calls to the API
It enables the developer to add business logic to most of the system events, including button on-clicks, related record updates, VF pages, LWC, and Aura Components.