Faith/belief/trust is invisible to people because it exists in the mind. But physical actions inspired by faith/belief/trust are visible to people. So that is why James said "Show me your faith without your works, and I will show you my faith by my works" (Jas 2:18). We need to see a person's works/actions/fruits to make any judgement about his true beliefs. So, for example, when I see people working as if their salvation is dependent on their obedience to God's laws (when they should have plenty of evidence that they regularly fail in that endeavor), my conclusion is that their real hope is probably misplaced. But I am not capable of drawing a firm conclusion on this because I can't see what's in their heart. I can only see physical evidence that points in a certain direction.
But God is not limited like we are. He knows when someone has stopped working for their salvation and has rested all their hope in Christ. His judgement is perfect because He sees everything perfectly. This is why we each must be dilligent to enter His rest -- because He knows for sure whether we have done it or not.
11 Let us therefore be diligent to enter that rest, lest anyone fall according to the same example of disobedience. 12 For the word of God is living and powerful, and sharper than any two-edged sword, piercing even to the division of soul and spirit, and of joints and marrow, and is a discerner of the thoughts and intents of the heart. 13 And there is no creature hidden from His sight, but all things are naked and open to the eyes of Him to whom we must give account. (Heb 4:11–13)