Normally, a given program's code runs straight along, with only one thing happening at once. If a function relies on the result of another function, it has to wait for the other function to finish and return, and until that happens, the entire program is essentially stopped from the perspective of the user.
Mac users, for example, sometimes experience this as the spinning rainbow-colored cursor
(or "beachball" as it is often called). This cursor is how the operating system says
"the current program you're using has had to stop and wait for something to finish up,
and it's taking so long that I was worried you'd wonder what was going on."
This is a frustrating experience and isn't a good use of computer processing power — especially in an era in which computers have multiple processor cores available. There's no sense sitting there waiting for something when you could let the other task chug along on another processor core and let you know when it's done. This lets you get other work done in the meantime, which is the basis of asynchronous programming. It is up to the programming environment you are using (web browsers, in the case of web development) to provide you with APIs that allow you to run such tasks asynchronously.