I don't like this phrase. Typically you'll hear it after something bad happens to someone, and they'll utter it, shaking their head and staring wistfully off into space. I suppose people say it to make themselves feel better about whatever happened. In reality, it's a worthless statement. Too often, I think it represents a person surrendering power and further externalizing their locus of control.
Of course everything happens for a reason. That's a truism that doesn't even deserve stating. How could anything happen if not for some "reason." Cause and effect. You never get the effect without some cause. The problem I have with this statement is that it often robs people of the introspection they should be experiencing to determine said "reason." The "reason" is often construed as some mysterious unknown, beyond the powers of mortal detection. What people cannot quickly and easily discern is chalked up to "fate" (which is merely a secular version of God). The idea is that there is a "good" reason for this bad thing happening, but that the reason simply isn't visible due to our limited perspective and/or information.
But people should only resort to such external attributions after they have reasonably eliminated all possible "reasons" that are within their control. For example, take a person who gets in a car accident and then afterward cries "Why me?? Oh well, I guess everything happens for a reason." Most likely, the car accident happened because of a driving error. Perhaps the error was the product of habitually poor driving. If the person is quick to look outward for some greater "reason" for the accident, he/she may fail to detect the real reason and accordingly continue his/her poor driving habits. The correct order would be to look inward, first, and then if nothing presents itself, chalk it up to "fate" or "life" or however you choose to describe that which is beyond your control. Alternatively, the person may opt strictly for self-pity, without any attribution whatsoever. Even then, he robs himself of the opportunity for introspection and potential growth.
Similar is the situation of a person recovering from a failed relationship. One option is to wallow in misery, concluding that it just "wasn't meant to be." (That's another phrase that irks me.) Another option is to look inward at what he/she might have done to contribute to the failure. Unless the person can honestly say that he did everything in his power to make it work, then it is premature to start attributing the cause to some mysterious unknown. Naturally, such introspection takes effort and can be uncomfortable. That's why I don't think it happens a lot. But it's the accountable and responsible thing to do, and is necessary for personal change.
Now even though bad things happen because of our own mistakes, that isn't to say that there isn't some greater lesson to be learned from those mistakes at a later point. And for those who believe in God, it might be said that the ultimate "reason" that thing happened was so that we would learn that future lesson. That's fine. My point here is simply that looking forward too quickly for that lesson may cause a person to miss out on detecting the true reason staring them in the face: their own behavior.
In his book "Man's Search for Meaning," Victor Frankl points out that one of the ways people find meaning in their lives is through experiencing unavoidable suffering. If the suffering is avoidable, then of course the solution is to avoid it (to me, this would involve detecting the cause of the suffering and reacting accordingly). If it is unavoidable, however, then that is when a person should start looking outward and transcending himself, to find (or create) the "reason" for the suffering. That reason then becomes a gem of meaning, which makes the suffering bearable. Same principle here.