James addressed a church undergoing persecution and told them to welcome trials with joy. He explains that we can be joyful in suffering because we know that God is refining our faith resulting in a steadfast spirit. The result is our perfection and lacking in nothing. It is what we long to attain. Therefore, we should have joy in the process knowing the end results.