Two essential components are needed for one to judge perfectly. The first is the wisdom to know all information about the situation at hand. Judging without complete knowledge leaves room for error. A good judge must be able to discern with total understanding. The second is the wisdom to know and understand the law completely. A good judge must fully comprehend the law by which they operate, lest they make judgments that are not according to the rules by which the judged are expected to conduct themselves.
Equipped with all wisdom and knowledge, the LORD God is the perfect Judge. In His omniscience, He sees not only what sins are confessed to Him or what concerns are presented to Him, but also those facts that are hidden in secret. He sees what deeds and what trials may go unseen by all others. The LORD not only knows all comings and goings of the universe, but knows also what is in every human heart. He knows what is uttered in truth and by what motive. Not only does God see what is every human heart, but He has also written in every human heart the Law by which all are to live. The LORD is the perfect Judge because He knows the Law which governs all people. In fact, He has written it. His judgments of right and wrong are dictated by what He has decreed. Even those who do not follow God inherently know what is good and what is bad.
So in His righteousness, the LORD judges fairly. Be mindful then, believer, to trust in the LORD as Judge. While we are limited in our understanding of all that surrounds us, the God Who judges is perfect. He sees and knows every heart. He is Creator and Keeper of His Law, and He is prepared to execute in perfect fairness.