Understanding mercury extraction mechanism in ionic liquids