Models are built in ArcGIS Pro using ModelBuilder.
Once built, you can publish these via ArcGIS Server, as geoprocessing services. Web applications can use the Geoprocessor
task object in the ArcGIS API for JavaScript to execute the models and retrieve the results.
Although the client is responsible for feeding the correct parameters to the model and unpacking the results, the actual models are run on the ArcGIS Server. This is because they are computationally expensive and, to work their magic, require various ArcObjects that are not available on the client.
Geoprocessing jobs are submitted to the server by your application, using the Geoprocessor
task object. The results are picked up after the service has completed. This process is illustrated in the following diagram: