otgw spoiler question

okay but has anyone else been wondering how the beast’s soul ended up in the lantern in the first place?

like

did someone do that to him as a punishment or did he do it so he could live forever or what

these are things that keep me awake at night