Usually we recommend books here (as well as provide a bit of exposure for our invited guest authors–myself included).
In this case, though, we’re pointing to a highly useful article on the Hebrew idiom of “I love X but I hate Y”.
This is especially pertinent in the case of God loving Jacob but hating Esau; as other commenters have noted, God does not hate Esau in the Genesis story, but chooses Jacob over Esau, not for Jacob’s own salvation over Esau, but to be the vessel of salvation history leading to the Messiah. Thus Esau is promised to have blessing in Jacob’s blessing.
The author of this article demonstrates how the comparative phrase is sometimes used in the OT and NT to mean comparative degrees or kinds of love, since Hebrew and Aramaic (underlying the written Greek) didn’t have ways to clearly express this preference in direct grammar. So idioms were used instead, such as this one.