Okay so this is my theory: When Wendy left Neverland Pan never stopped thinking about her. That's the reason he got so dark and insane. When she returned he never wanted her to leave again. That is why he caged her and kept her there for so long because he was afraid of losing her.