This wise saying addresses our spiritual connection to God. Think of it as a two-way vertical connection by means of His Word (He talks to me) and prayer (I talk to Him).
“The law” is not understood as the law of the land (human government) but God’s Law. While technically the first five books of the Bible (Genesis – Deuteronomy), we can understand “God’s Law” here as simply His revealed message to us.
So, when we “turn a deaf ear to the law” and refuse to listen to what God is saying to us, He does not promise to listen to us either – our “prayers are detestable” to Him. It is not that He is mad at us or hates us. Actually He loves us with unconditional “tough” love and will not enable the poor decisions we make.
Our refusal to keep regular meaningful contact with Him will ultimately result in so many unnecessary difficulties to our lives. Like a good parent exercising tough love, God reminds us that listening to Him is a good idea.
We need to stay connected and open to receive answers from Him for our daily struggles. And this verse reminds us that He knows how to get our attention!