As Christians we often discover that we what we thought would be good and for God’s glory might differ from what he has decreed will be good and for his glory. Take the recipients of this letter.
They had believed in Jesus, which was the outcome of his revealed will (believe the gospel) and his secret will (he had planned it before the foundation of the world). There we can easily see how God’s goodness is revealed and how his glory is connected to their good.
Their devotion to Jesus, however, had led to persecution and their scattering. The possibility of persecution is stated in God’s revealed will, but the precise nature of it (who did it, when they did it, how they did it) and the consequences of it (where the readers ended up) is part of his secret will. The persecutors are responsible for their actions, because no one forced them to do it even although their actions were part of God’s secret will. Yet we can see that God’s goodness was revealed in him saying this could happen and how he would help them when it happened. And that would be for his glory.
The readers’ proper response to this new situation is described in his revealed will (the Old Testament) and their actual response was part of his secret will. It was still their response for which they were responsible for choosing. We can see from the letter that they had made wrong choices, but their wrong choices did not mean that God had to adjust his secret will. Yet God’s goodness was revealed in giving them the information as to how they should react in their new circumstances.
When James discovered what had happened to them, he decided as their pastor to send them a letter. We are not told the process by which he came to this decision. Nowhere is there a statement in God’s revealed will that he should do so. So his decision to send it was part of God’s secret will. Yet the decision to send it would be in line with the general principles revealed in God’s Word as to how a pastor should react. And God’s secret arrangement for this letter was intended for the good of the recipients even although they had sinned against his revealed will.
The letter was sent according to God’s secret will and once written it became part of his revealed will for them. So when we look at the big picture we can see that they had believed according to his revealed will, had suffered for the faith according to his revealed will, had responded wrongly to his revealed will initially, and now had received a letter from him that revealed to them what they should do. All that was at one level, and at another level it was all according to his secret will.