By default, they know some details
DMG page 24 discusses this very topic in the section Bringing Back the Dead:
A soul can't be returned to life if it doesn't wish to be. A soul knows the name, alignment, and patron deity (if any) of the character attempting to revive it and might refuse to return on that basis.
The section goes on to give an example of an evil cleric trying to raise a good knight, and the knight's soul refusing to return based on the information he receives about her from the resurrection, causing the resurrection to automatically fail. It even describes how the evil cleric might want to trick the soul into returning by forcing a good cleric to perform the resurrection and then capturing the raised knight once the process is complete.
Of course, the DM can modify this as they see fit
The DM controls the world, and that can include circumstances surrounding death and resurrection. If they decide that the soul knows more or less information, or is in some way prevented from returning to life, then that's the way the game works. That's why I describe the rules in the DMG as the default; anything in the book can be changed. To get concrete details in your game, ask your DM if their world's rules for resurrection align with those in the DMG.