SAP S/4HANA supports the following approaches to extensibility.

In-app extensibility supports extensions directly within the SAP S/4HANA software stack. You benefit from the fact that no stack switches are required to manage and run the extensions.
Side-by-side extensibility provides a broader approach that leverages all the capabilities of SAP Business Technology Platform (SAP BTP). The extensions are loosely coupled to SAP S/4HANA and are based on stable remote APIs and events. This reduces software update costs on both sides. The core software and the extensions can be updated independently.
Use cases for side-by-side extensions are completely new applications. For example, based on the SAP Fiori user experience with native SAP HANA development or integration with other SAP applications and with third-party solutions.
Let us now discuss the different extensibility options in more detail.

The first option is the classic ABAP custom development, which is already familiar from SAP Business Suite. Here you have the full freedom of custom development using the ABAP standard language with ABAP development tools, which can be either the tools in Eclipse or the tools provided in the SAP GUI.
You can use modification-free extension technologies here, but in the on-premise installation of SAP S/4HANA you still have the option to modify ABAP code, although this is not recommended. The disadvantage of this programming model is that software updates require a large adoption effort in customer or partner code.
The second option is key-user extensibility to support line of business driven adaptation projects. The most familiar patterns of this extensibility, such as field extensions, are offered to key users. These are personas who have deep business knowledge, but not necessarily technical expertise. Extensions are built based on robust APIs, so the lifecycle is decoupled from the core software. This means that software updates for the core software and for the extensions can be performed independently.
The tools set up for key user extensibility are web-based, and SAP provides a special version of the ABAP language called ABAP for Key Users. This is a simplified and restricted version of the ABAP programming language designed for robustness, security, data consistency and simplicity.
Key user extensibility is not designed to develop applications from scratch, nor is it intended for larger development teams. The target group are key users and consultants who know their business and use this approach to implement their requirements.
Side-by-side extensions run on SAP BTP and are always based on remote APIs and events. For Java- and Node.js-based extensions, a corresponding SDK makes it easy to use the available APIs and events.
Side-by-side extensions can also be created in the SAP BTP ABAP Environment. Such extensions use ABAP as the programming language and are also implemented based on remote API and events.
SAP offers a special ABAP version for SAP BTP, which is also a simplified and restricted version designed for robustness, security, data consistency and simplicity. However, the restrictions are less strict than for ABAP for Key Users.
As you can see in the figure, all enhancement options are available for the on-premise version of SAP S/HANA, while custom ABAP development is not available for the cloud version.