Just for sake of discussion here is an explanatin from the Dictionary of Biblical Imagery:
Occurring in the Bible as often as it does, the figure of three is an evocative image, rich with connotations. On the surface it is simply a tidy number; partly due to its prevalence in literature, its familiarity to the reader can make it seem a more natural quantity than two or four. Thus the dreams Joseph interprets for Pharaoh’s cupbearer and baker are rife with quantities of three (Gen 40:10), and Jonah is stuck in the belly of a fish for three days and three nights (Jon 1:17).
But the significance of three as a literary motif is not purely arbitrary. Three is the minimum number necessary to establish a pattern of occurrences. A single event can be pure chance; a pair can be mere coincidence; but three consecutive occurrences of an event serve as a rhetorical signal indicating special significance. For example, only after the Lord calls to Samuel for the third time does Eli realize that it is the word of the Lord coming to the boy (1 Sam 3:8).
Because the number three conveys a sense of significance, biblical episodes that occur in sequences of three often generate a sense of expectation; once an event has occurred for the third time, something new and unexpected is likely to happen. For instance, the angel of the Lord appears in the path of Balaam’s donkey but is invisible to Balaam; when the donkey turns aside, Balaam beats it. After this episode has occurred three times over, the donkey suddenly speaks to Balaam (Num 22:28). Similarly, Elijah has a sacrifice and altar on Mt. Carmel doused with water a full three times before the fire of the Lord comes down to consume it (1 Kings 18:34). In the NT, Jesus prays in Gethsemane three times over and each time discovers his disciples sleeping; only then does the mob arrive to arrest him (Mt 26:36–47; Mk 14:32–43). In each of these instances the triple occurrence of an episode generates an expectation in the reader that a new and significant turn of events is about to take place.
Thus an episode occurring in threes is a motif that points to further developments yet to unfold. But three also conveys a sense of completeness or thoroughness to the episode itself; when an event happens three times over, the reality of that event gains emphasis. When Peter denies for the third time that he knows Jesus, it conveys the sense that he has denied Jesus utterly; the denial is seemingly permanent (Mt 26:74; Mk 14:71; Lk 22:60; Jn 18:27). In Luke’s Gospel, following Peter’s three denials is a parallel episode in which Pilate speaks to the crowd regarding Jesus’ fate. Three times Pilate tries to release Jesus, and three times the chief priests and rulers reject him; this repetition indicates the thoroughgoing nature of their rejection (Lk 23:13–25). Then, following Jesus’ resurrection, he appears to his disciples. According to John’s Gospel, upon his third appearance to them, Jesus asks Peter three times if he loves him, and each time Peter confirms that he does (Jn 21:15–17). Thus Jesus restores Peter’s relationship to him in a manner that emphasizes the certainty of his restoration as thoroughly as Peter’s earlier denial was emphasized. The threefold occurrence of each episode underscores its reality and significance.
Whatever the specific effects, the pattern of threefold repetition is recurrent in folk literature from all cultures. Examples abound in the Bible. Jesus told parables involving three stewards, three types of soil that are inhospitable to crops and three degrees of abundance from soils that produce crops, three invitations to a banquet, and three travelers who encounter a wounded man on the road. The book of Job is structured as three symmetrical cycles of speeches. Peter sees sheets filled with animals and hears an accompanying voice three times (Acts 10:16). In the annunciation story surrounding the birth of Samson (Judg 13), we hear the announcement from the angel and the prohibitions of the Nazirite vow three times—by the angel to Manoah’s wife, in her recounting of the event to Manoah and in a return visit from the angel. The Aaronic benediction consists of three pairs of statements (Num 6:23–24).
A related motif is three plus one, in which a common element occurs four times, but with a crucial change introduced the fourth time. Delilah’s temptation of Samson (Judg 16:4–21) presents the pattern in its pure form. Other examples include the fable of Jotham (Judg 9:7–15), the ascent of Elijah into heaven (1 Kings 2) and a formula found in OT prophecy and wisdom literature, “for three transgressions … and for four” (Amos 1:3, 6, 9, 11, 13; 2:1, 4, 6) or “three things … and four” (Prov 30:18–19, 20–23, 29–31).