It is mostly to do with how your brain processes information. Firstly, the brain works on a process of association, therefore, the answer may appear when you're not even trying, but instead think of something you've unknowingly associated with that name or face.
The second part is the brain's natural memory cycle. You say that the answer normally comes to you deep during the night. This could be beacuse of the brain processing memory information during sleep. This could well be associated with the hormones that make you sleep, and there are more of those during the night, being released as directed by your body clock. This means that the answer may come to you during the night because, with relatively low stimuli and those sleep hormones, the brain is mulling over the information you've learnt during the day, and just stumbles across that face or name.