There are various ways to interpret the Hebrew preposition (עַל), rendered “to” in the ESV.
With a reference to parents and children, the preposition can mean inclusion and be translated as “together with” or simply as “with” or “as well as” (Genesis 32:11, “[Esau] may come and attack me, the mothers with the children,” or Hosea 10:14, “Mothers were dashed in pieces with their children”). If this is the correct translation, then the verb “turn” refers to repentance toward the Lord, giving the sense that fathers will return to the Lord together with their children, and children will return to the Lord together with their fathers.
With a reference to parents and children, the Hebrew preposition can mean “to” or “toward” (Psalm 103:13, “As a father shows compassion to his children”). If this is the correct translation for our verse, then the verb “turn” refers to agreement with others, giving the sense that the fathers will agree with their children, and the children will agree with their fathers.
Both are possible, but if the author meant that the fathers as well as their children will return to the Lord (who is not actually mentioned in the verse), what more would be added by saying that the children as well as the fathers will return to the Lord? It seems that the two inverted references (fathers and children, and children and fathers) favour the second interpretation, as in the ESV and most other English translations. The fathers are not in agreement with their children, and their children are not in agreement with their fathers. The two parties are against each other. In Ezekiel 5:10, there is a similar inversion of father/son relationship. In this place, the two are clearly opposed to each other. Therefore, fathers shall eat their sons in your midst, and sons shall eat their fathers.
In the verse we are presently considering, the fathers are in disagreement with their children, and the children are in disagreement with their fathers. But the coming of “Elijah” will turn the hearts of each party towards the other, bringing agreement.
6 And he will turn the hearts of fathers to their children and the hearts of children to their fathers, lest I come and strike the land with a decree of utter destruction.”