The object of reciting the various berachot is to instill within us the certainty that the LORD watches over all of His creatures at every moment. By doing so, we are repeatedly reminded that God does not dwell in some detached abode, but rather that everything that exists does so by virtue of His grace and sovereign purposes. Therefore, when you experience an especially joyous event, you praise and thank the LORD -- and pronounce the "Shehecheyanu" blessing. On the other hand, if, God forbid, you experience a tragedy, you must realize that this too is the result of God's providence, and though you might not understand the reason for such an event, you must regardless have faith that God is a fair Judge and that all of His decisions are perfectly just and righteous. In such circumstances we therefore recite, "Baruch Dayan HaEmet" (Blessed is the fair judge).