When the son came to his senses, he said, ‘How many of my father’s hired servants have food to spare, and here I am starving to death! I will set out and go back to my father and say to him: Father, I have sinned against heaven and against you. I am no longer worthy to be called your son; make me like one of your hired servants.’ So he got up and went to his father.
But while he was still a long way off, his father saw him and was filled with compassion for him; he ran to his son, threw his arms around him and kissed him.
The son said to the father, ‘Father, I have sinned against heaven and against you. I am no longer worthy to be called your son.’
But the father said to his servants, ‘Quick! Bring the best robe and put it on him. Put a ring on his finger and sandals on his feet. Bring the fattened calf and kill it. Let’s have a feast and celebrate. For this son of mine was dead and is alive again; he was lost and is found.’ So they began to celebrate.
The father here pictures God our Father. Notice the son had planned to ask to "be one of the father's hired servants." Because of his sin he felt like he had to earn a place in his father's house. The father didn't even let him finish the speech he had prepared. He immediately started lavishing gifts upon him and started throwing him a party. The father's love and graciousness (grace) had nothing to do with what his son could do for him.
Likewise the older brother worked for his father but was angry that he wasn't getting what he felt like he deserved for the work. The father said to him, ‘you are always with me, and everything I have is yours.’ God doesn't cooperate with legalism. He didn't reward the older brother for work because his son already had whatever he could what. All he had to do was take it and enjoy it.
God would be giving a misrepresentation of Himself & His unconditional love if He let legalism work. He resists cooperation with those who try to earn from Him.
"God resists the proud, but gives grace unto the humble" (James 4:6)