What was the purpose of the Tree of the knowledge of good and evil

I’m not following this. Who is the child? Are you saying that there was a time when God himself didn’t know right from wrong? That seems a rather astonishing statement coming from a Christian. Is this a mainstream view?