God is fair but not fair to everyone. The fairness of God partly depends on the character of a person. It is very clear in God’s word that He is just.
If someone is fair to others, then God’s law demands that God must be fair to that person. But if a person is unfair to others, it is demanded in God’s law for God to be unfair to that person.
Therefore, God’s unfairness to someone who is unfair to others is actually fairness. Why would a just God be fair to someone who is unfair to others? That would be injustice.
But then there is the aspect of God’s sovereign choice. This is where God is permitted in His law to choose what He wills.
God may decide to be fair to an unfair person and He won’t be breaking any law. God can also choose to be unfair to someone who is fair to others and He won’t be breaking His law.
We see an example of God being unfair to someone who has been fair to others in the book of Job. The book of Job begins with God acknowledging that Job is righteous and upright.
From the introduction, we expect God to be fair to Job because Job was fair to others. But then God permits the devil to harass Job. This makes Job question the fairness of God.
Even though later on God restored what the devil had destroyed, it is beyond doubt that Job received an unfair treatment from God.
However, even when God treats someone unfairly, He is still fair. In the case of Job, though God treated Him unfairly, it was a lesson that would help many others. It is fair to have one person learn a hard lesson for others than take everyone through the hard lesson.
Also, God restored double what Job had lost which makes us question if the harsh treatment was unfair.
All in all, the rule is that God is fair but there are exceptions.