God, of course, knew everything, and he did not ask for his own benefit, but to force Adam to explain himself. The questioning starts with Adam even though Eve was also with him, because it was the man who was created first and who even before the four had the primary responsibility within the marriage.