So I just watched over the garden wall, and like anyone else who watched it (probably) the ending still left questions like where and how and why.
Well here’s my two cents for anyone who wants to know.

I think they pulled the twisted purgatory card. And here’s why:

-Greg and Wirt fell into a river in October which had to have been freezing cold, and as the series went on it got progressively colder and colder. Starting with Sun, then fog, rain and at last snow. Similar to what a person would feel after being in cold water for too long.

-When the Edelwood was consuming Greg he had trouble breathing. Similar to as if he was drowning.

Now, the beast is interesting because you could say he’s the devil but that just seems odd. I think the beast is the embodiment of everyone’s fear.

-After the woodsman blew out the lantern, the beast’s influence/magic was voided and Writ wakes up and saves his brother. As well as everyone else they encountered lives go back to normal. As if their doubts about themselves where beaten and they lived happy lives after.

-everyone in the land over the garden wall knew who the beast was without even seeing him. One common thing the characters in the land had was fear, fear of the unknown, or the future more like.

As for the where, the land over the garden wall isn’t a place. It’s more of a conjunction of consciousness.
At the opening and beginning movie things, we can see through the eyes of someone (probably the beast) different sorts of people who seem to be from different periods of time.
-medieval townsfolk
-renasance architecture
-Greg and Writ being from a modern setting
-the pumpkin people being early pilgrims
-Beatrice being from maybe 1500 England (idk)
All of these people at one point felt with fear and may or may not had a near death experience similar to Greg and Writ. (Because we know for a fact that was how Greg and Writ got to the land over the garden wall, so we can assume something similar happened to the others.)
And while they’re unconscious, they’ll go to this land and basically take a test of willpower to see if they’ll continue living or give up, become edelwood, and die in real life.

So sum up,
When- before you die after a near death experience
Where- a place out of time and is coneccted to others who had a similar experience and are fearful.
Why- to test and grow individuals willpower to see if they will pull through and live on, or not.