Most developers learn async/await as syntax that makes asynchronous code look synchronous. You await something, and the code below it runs after. It reads top to bottom, like normal code. That mental model is mostly fine for writing async functions, but it hides what's actually happening. And once you need to debug a weird execution order or understand why something runs when it does, the surface-level model breaks down.

The thing most people get wrong: await looks like it pauses execution. It doesn't. Not in the way you might think.

An async Function Is Just a Function That Returns a Promise

Start here, because everything else follows from it.

async function getData() {