The ability to forgive is a major factor. If the couple can forgive each other for past mistakes or hurts, it can make the divorce process less painful. Additionally, financial stability plays a role. If they are able to sort out financial matters fairly and without too much conflict, it helps. And sometimes, new opportunities that come along after the decision to divorce, like new career opportunities or the chance to travel and explore new interests, can also be part of what makes a 'happily divorced' scenario based on a true story.
One key factor is acceptance. Accepting that the marriage is over and it's time to move on. Another is honesty. Being honest about feelings and needs during the divorce process.