Parshat Bechukotai

Vayikra 26:3-4
If you follow My laws and faithfully observe My commandments, I will grant your rains in their season, so that the earth shall yield its produce and trees of the field their fruit. 
Vayikra 26:21
And if you remain hostile [alt: with/in keri] toward Me and refuse to obey Me, I will go on smiting you sevenfold for your sins.
Sifra, Bechukotai 5:5
“And if you walk with Me bekeri and do not desire to listen to Me, then I shall smite you even more, seven-fold according to your sins.”:  You made My Torah “incidental” in the world — I, too, will make you “incidental” in the world.
[Note that Rashi interprets this as meaning following the mitzvot irregularly. Kugel and Steinsaltz interpret it as meaning viewing events in the world as being driven by chance.]
James Kugel
[if] the sense of “going with/in keri”– [is] believing that everything is ultimately up to chance–then such an idea is clearly being opposed to what the the opening verse … says.
Is this a guarantee? It certainly doesn’t seem to be. But, as numerous psychological experiments have shown, what one sees has a lot [to] do with what happens behind one’s eyes. In this sense, “going with My laws” is a commitment, quite the opposite of “going with keri.” Both are indeed a way of “going,” but they point in opposite directions.
Rabbi Adin Steinsaltz
According to an interpretation cited by Rashi, this refers to the sin of interpreting every event in life as an accident (mikreh). When something bad happens, it is often easy to write it off as an accident. This can minimize the impact of such an event, disregarding its greater implications for one’s life.
When, occasionally, someone does attempt to infer some lesson, the conclusion drawn is generally that someone else is to blame. It is in our nature to look around and search for a guilty party, to determine on whom to pin the blame. … Conversely, when something good happens, it is common practice of many people to take credit for it. … One way or another, everything that happens, whether good or bad, makes no impact and effects no change. This is the precise definition of “If you walk contrary with Me.”
One who does not walk contrary is one who attaches meaning, importance, and significance to everything that happens around him. … Whenever any major event happens, one must always ask: What does this mean? What does it imply? What are its implications? Such a comprehensive examination is always challenging for everyone involved, but it must be done …
Rabbi Yehudah Leib
“If you follow My laws and observe My commandments, I will give you your rains in their seasons”: Even though the sages taught that there is no reward in this world for fulfilling the commandments, that is true only rationally and from our human point of view. But in fact, God has made the law of the entire universe depend upon Torah. Since it is taught that the world was created through Torah, the connection between the world and Torah is higher than the rational mind [can reach]. But a person who transcends his own self, truly “following His laws,” is given sustenance y Torah in this world as well.
Each Jew has certain particular paths to walk. One who serves God, longing always to find those paths that are unique to him, will be led by God in a true way. … This is the meaning of “If you follow My laws”: it is within a person’s power to see the ways and patterns that God has inscribed into the human soul.
All the events and thoughts that occur to a person are for this purpose, to make his witnessing [of God] more clear. They are like the questioning, investigation, and cross-examination that a witness has to undergo in order that the testimony be clarified.