When an employee resigns, it is really difficult to get honest feedback. This usually includes manager, HR and team members, excluding those who have good personal relationship with leaving employee (and they don't tell what they heard).
I think often the problem is that leaving employee wants to avoid burning any bridges, even though honest ("I'm switching to that another company because they offer thing X and opportunity Y") - not insulting ("I'm leaving because that coworker is ") - feedback could improve the relationship with previous workplace.
Obvious first step for getting feedback is to ask for it, and react to it in a positive way (fixing issues that people told; not ridicule anything etc.).
Edited: I'm not talking about general trends in resignations - e.g after reorganization, people are leaving, or after pay raises were frozen. The most interesting case is when seemingly happy employee switches to competitor without getting (remarkable) pay raise or better benefits, nor the location of the office is better.
When that's not enough, what are the next steps? How that could be improved?