Arthur J. Droge ('The Status of Peter in the Fourth Gospel: A Note on John 18:10-11', Journal of Biblical Literature 109.2 : 307–311) says a number of commentators have observed that the Fourth Gospel exhibits a marked tendency to exalt the Beloved Disciple at the expense of Peter, with frequent episodes in which the Beloved Disciple and Peter appear as rivals.
Christopher W. Skinner ('Who Was the Beloved Disciple') says the beloved disciple responds to Jesus in a way that the narrator considers praiseworthy, while Peter expresses confusion, doubt, and misunderstanding before he denies that he knows Jesus. In a sense, the beloved disciple gets everything right: twice he is found in a location that indicates his loyalty to Jesus (John 18:15-18, John 19:26-27); he responds appropriately by believing at the empty tomb, even when he does not understand (John 20:3-8); he also recognises the risen Jesus from afar while the other disciples do not (John 21:7). In what is probably the most important comment about the beloved disciple, the narrator depicts him as “leaning back on the chest of Jesus”. Each of these depictions reinforces the idea that the beloved disciple should be seen as an ideal follower of Jesus — one with whom any faithful reader can and should identify.
It is only in Luke and John that Peter, or any disciple, went to the tomb of Jesus. The author of John rarely contradicts Luke's Gospel, which may have been read by some in the Johannine community, but sometimes provides further information that alters our understanding of what Luke had said. John knew that Luke portrays Peter as entering the tomb and seeing Jesus' clothes lying there, so if there was another disciple who also ran to the tomb, Peter must have been the first to actually enter the tomb. However, it would not be a contradiction if the other disciple outran Peter and arrived first at the tomb. In Luke, Peter is the disciple who receives full credit for verifying the story that the women had brought back, but in John he has to share that credit.
The use of repetition, typically three times, was a rhetorical technique used at times in both Luke (and Acts) and John to verify the facts stated.