Why ajax button calls submitForm?
In Drupal, the submitHandler() method of your form definition will always be called UNLESS you have a custom handler attached to the submit button that is clicked. In the case of #ajax buttons, you add your own custom handler, then rebuild the form in that handler.

'#type' =&gt; 'submit',
'#ajax' =&gt; [
  'callback' =&gt; '::ajax_function',
  'wrapper' =&gt; 'my-button-wrapper',
],
'#submit' =&gt; ['::ajaxButtonSubmit'],


Then:

public function ajaxButtonSubmit(array &amp;$form, FormStateInterface $form_state) {
  $form_state-&gt;setRebuild(TRUE);
}


By doing this, the default submit handler is not called, and your ajax submit handler is called instead, which then ensures the form is rebuilt instead of reloaded.