The product team implemented a JS-based form submission handler in 2.9 to ensure that all submissions, regardless of the embed/submission method (default postback, legacy iframe-based Ajax, or new experimental real Ajax), are processed in a consistent way, and that add-ons can integrate into the process in a standardised way without writing their own full submission handlers.
It also handles blocking duplicate submissions, adding the honeypot version hash to the submission, and triggering integrations like reCAPTCHA.
The recommended way to perform custom tasks between the button being clicked and the request being posted to the server is by using the new gform/submission/pre_submission filter:
Another usage example can be found here: