Yehuda, Tamar and Moshiach
The Torah in Parashas Vayeishev relates the story of the relationship between Yehudah, and his daughter-in-law Tamar. According to the Sages, at the time when Yehudah and Tamar were having relations, G-d was involved with "the light of the Moshiach" (i.e. the messiah) - who would rise from the household of David, stemming from the relationship between Yehudah and Tamar.
How strange! Was it not possible for G-d to bring about the Moshiach through a normal relationship? Why did G-d choose this abnormal and "illicit" relationship as the heritage from which the savior of Israel would eventually come to be? Why not a nice regular yiddishe wedding, with dancing and celebration?
Perhaps this scenario would be more understandable if we realize that G-d operates using the rules of Middah Knegged Middah (a measure for a measure). This means that G-d causes certain events to happen as payback for a person's previous actions. Yehudah was the one who had saved his brother Yosef from the other brothers by telling them to sell him to the Ishmaelites, rather than letting him die in the pit into which they had thrown him. Yosef would eventually end up in Egypt, and his stay would culminate with the enslavement of our people, the Exodus, and the receiving of the Torah at Sinai.
This action on the part of Yehudah eventually resulted in the most significant event in our history. G-d wanted to reward Yehudah for this action measure for measure. Yehudah, however, had no idea that his actions on behalf of Yosef would ever lead to those events. Thus, his reward for that act needed also to come about in such a way, that he would have no idea what would emerge. Moshiach, who represents all that is holy, would be the last person Yehudah would have expected to emerge from his illicit union with Tamar. This was G-d's way of paying Yehudah back measure for measure.