I believe the narrative in Ps 82 makes these points clear:
God is the judge.
Satan is standing before God pleading his own defense at this own trial.
His defense is this: God you are an unjust judge ... the reason being that you accept "these persons" who are needy, poor, fatherless, in physical...