In my humble opinion, works in both the Old and New testaments are about showing love and compassion to humanity. It was more .. codified in the old testament but still steered people to think and act towards others with at least a show of good will and to love others as God loves us. The New testament expanded 'works'. It was no longer done to keep a law, but as an outpouring of the love and forgiveness graced to us by God. In truth many in the OT did very well with 'works' above just following the law and also, in truth, many today rarely consider the needs of others. The goats and the chaff referenced in other passages represent, basically, the same group. The unfortunate souls.