From the docs:
If this method is called, the default action of the event will not be triggered.
So if your button is an input submit button for example, the event.preventDefault()
will prevent the default behaviour of your button and prevent your form from submitting and reload the page. This is normally helpful when you want to apply AJAX call.