How did he escape?

How did he escape?

fucking ghosts

Psychic powers

Ghosts

They weren't just figments of his imagination. That's the moment in the film that confirms that.

Danny opened it

ghosts
did you even watch the movie?

yes

If you look closely at this scene you can figure out what products Jack used to melt the lock off.
Kubrick set it up this way because he figured the audience would know how he did it but years later people still think it was ghost
(Though to be fair he left it vague on purpose)
I think mythbusters did an episode where they used the same products and said the lock would have melted

shining is hereditary, where you think the boy got it?

The mailman?