Child: Mister Jackie is a bad man.
Detective: Why is he a bad man, sweetie?
Child: He follows me into the bathroom.
Detective: Why does he do that?
Child: When I have to go.
It's a dialogue from a TV show. I'm not sure it's 'why' or 'when' but the script says it's 'why'.
Detective asked 'Why does he do that', but why he anwered 'When I have to go'? I can't understand what it means. Please help me to understand it perfectly!
(My native language is not English. Please be kind to me. :-))