Task scheduling and yielding work by having the program execute a script until it hits a yield, at which point it stops where it is and "puts it aside" in a queue for later. In most cases, you'll start a bunch of tasks from @Initialize, which only runs once, so the tasks started there will run a bit, yield (or end), and eventually @Initialize finishes. After this the @MainLoop runs once per frame, even if it's empty or you didn't write anything. If you leave it like this without a yield in it, there's nothing to tell the script engine to go back to those other tasks. If you put a yield in, then the MainLoop will hit it, the script engine goes "ok I'll save the MainLoop for later" and puts it at the back of the task queue, picks up at the start of the queue, and goes through all the tasks until it reaches the MainLoop again, which might have some more code left, finishes, and the script waits for the next frame for it to run again.
To explore this, you can try putting two yields in the MainLoop, and all the tasks will run "twice as fast", because the task scheduler will go through the whole queue twice before the MainLoop ends.