Leviticus defines in detail what constitutes incest. There are three reasons that I can think of for prohibiting it. One is that it produces inbred children who are often genetically inferior in a variety of ways to normal children. A second is that it must produce all sorts of emotional wringers and family distortions and dysfunctions. . And a third is that it is tacky.
My guess is that since Israel was a pastoral country with herds of goats, sheep, and cattle, they were probably well aware of the biological undesirability of inbreeding. It was common knowledge. The writer of Leviticus was certain to have been well aware of it.
The one good thing that can be said for it is that it keeps family property from being dispersed and shared outside the family. Royal families and the extraordinarily wealthy skirt as close to the prohibitions of Leviticus as they can. One thinks of the Hapsburgs and of the Rothschilds. Where land was the basis of livelihood and arranged marriages the norm, avoiding dispersing the family landholdings would have been of great importance.
So there were good reasons to do it, and good reasons not to do it.
There are all the prohibitions one would expect, parents and children, grandparents and grandchildren, siblings, aunts/uncles and nieces/nephews, and so on.
But a few are less clear. It is prohibited for a man to fool around with his stepmother, his father's second wife. Even though she is no kin of her stepson. Similarly it is forbidden to get too chummy with one's mother-in-law. Again the relationship is by marriage, not by blood.
The incest prohibitions in Leviticus are distinct from the adultery prohibitions elsewhere. So presumably these cases would arise after the death or divorce of the intervening party. For example, the stepmother presumably would only become an issue after the death of the father or her divorce from him. Similarly the mother-in-law would become an issue only after the death or divorce of her daughter.
So what is the reasoning behind this abatement of biblical cougars? Why NOT sleep with a sexy stepmother or a hot mother-in-law?
One reason was examined in the 1962 black and white movie "Phaedra". There a young Anthony Perkins becomes involved with his stepmother, played by Melina Mercouri. The movie was an adaptation of Euripides' play of the same name. In the Greek myth and tragedy and in the movie, Phaedra's husband Theseus is not only alive but also armed and homicidal. In every version of the story the son, Hippolytus, ends up dead.
Similarly Reuben is stripped of his primogeniture rights by his father Jacob when he is caught with Jacob's concubine Bilhah. This is also an example of Jewish mildness and civilization compared to Greek brutality and savagery.
So the problem is that often the intervening party is NOT dead or divorced. And the Torah comes down on exactly the opposite side when the intervening party actually is dead. The example is levirate marriage. When a man died, his brother was required to marry the widow, his sister-in-law.
All of these rules are subject to the Arkansas Exception.