أُولَٰئِكَ عَلَىٰ هُدًى مِنْ رَبِّهِمْ وَأُولَٰئِكَ هُمُ الْمُفْلِحُونَ
Those are upon guidance from their Lord, and they are the successful. (al-Baqarah 2:5)
The preceding passage has already described the God-conscious. “أولئك” points back to that described group, before the judgment of guidance and success is given. Its function is not simply to indicate distant persons; it gathers earlier attributes into one identifiable referent.
A demonstrative can also prepare a following description or reinforce prior reference. To analyze it properly, identify what has already made the referent recognizable to the hearer and what new judgment follows the gesture.