Why HTML form with AJAX submit gives 404?

Imagine you have a simple HTML form with AJAX submit. From time to time your users reports 404 error. You ask yourself: what's going on?