Keeping the mitzvot protects the Jew from external enemies, from natural disasters, and from becoming the agent through which G-d brings punishment into the world.