Why does the Lord ask Cain where Abel is, in Gen 4:9?

Not because he does not know, but in order to alert Cain that he knows about the situation—to raise the issue.