The short answer
Social rehearsal is the habit of mentally practicing a conversation before it happens, or replaying it in detail after it's over. In small doses it's a normal, even useful, form of preparation. For some people it becomes near-constant — a script being drafted or reviewed almost anytime a conversation matters.
Where it's useful
A little rehearsal genuinely helps: thinking through how to phrase a hard message, or considering how someone might react, can make a real conversation go more smoothly. The line gets crossed when rehearsal stops being preparation and starts being a way to manage anxiety about the conversation itself.
Why the replaying afterward happens too
After a conversation, rehearsal shifts into review — checking the actual exchange against the version you'd mentally scripted, looking for gaps between what you planned to say and what actually came out. That comparison rarely lands anywhere conclusive, which is part of why it can run for so long.