Why ajax doesn’t work on certain wordpress hooks and reload the page instead?

Why ajax doesn’t work on certain wordpress hooks and reload the page instead?