The image on the right may appear to be upside-down to you.
In the world of computing, a common model for software stacks involves initializing a stack pointer to a memory address referred to as the "bottom of the stack". As items are pushed onto the stack in the form of stack frames and frame items, the stack size (the offset of the SP from the bottom of the stack) increases. Conversely, the stack size decreases as items are popped off the stack.
It should be noted that the depiction on the right follows the convention where the bottom of the stack is situated at the bottom of the picture.
The global execution context rests at the base and will only resume once the execution contexts of function A' have been removed from the stack above it. Function A's execution context, in turn, will wait until function B's context has been cleared from above.
Execution contexts do not possess inherent "priority"; rather, they ensure the correct sequence of program execution when functions are called and return to their respective callers.
One interesting point to consider is that recent JavaScript features such as the 'await' operator can internally store and retrieve execution contexts for later resumption after certain asynchronous events or operations take place.
Furthermore, performing actions in the "global context" implies that the global object and lexical environment form the entirety of the code's scope chain. This fact holds true not just for script file executions but also for callouts from the event loop.