Hard to say without knowing more details. Fictionally, it could be anything you can imagine. Someone lost in the forest may be fine. A prisoner of monsters the PCs can free. A prophet who has received visions of the PCs and finds them to join their quest. Someone who is already at the dungeon for their own reasons. Etc.
This is partly why I have the PCs establish backup characters at the start of every campaign. If someone dies, we tap the new character in with no issues because we've planned for it by establishing the necessary connections and backstory in advance. In my current campaign, for example, the PCs have a caravan. Their active characters go out and adventure while the caravan, guarded by their backup characters, provides a safe place to long rest. When a PC dies, they can just call up the appropriate backup character to take his or her place seamlessly.