Instead of the same idea being compared, opposite ideas are contrasted.
The curse of the LORD is on the house of the wicked,
But He blesses the home of the just.
Notice that it does not have to be a perfect contrast. Both lines speak of the Lord and of houses or homes and are thus also synonymous in regards to those elements.
Foxes have holes
and birds of the air have nests,
but the Son of Man has nowhere to lay His head.
The first two lines are synonymous. The repetition emphasizes that all creatures have a home. But the third line forms a antithetic. The Son of Man is not an animal and he doesn’t have a home.
Where there is no revelation, the people cast off restraint;
But happy is he who keeps the law.
The order of the comparisons or contrast doesn’t have to be same between the lines. Notice here there is also a contrast in number between many people and the individual. This indicates that only a few follow the law (Matthew 7:13-14).
Better is a dinner of herbs where love is,
Than a fatted calf with hatred.
Instead of a direct contrast, we have a comparison where one is better than another.
My flesh and my heart fail;
But God is the strength of my heart and my portion forever.
Not all lines are exact parallels in structure. The first line gives two things that fail because they are mine. The second line says the one God gives two things that last.