In some sense, John the Baptist did not know who Jesus was. This was revealed to him at the baptism of Jesus, when the Holy Spirit descended as a dove upon Jesus. This prompted John the Baptist’s testi- mony that Jesus was the long-foretold “lamb,” which God would send to take away the world’s sin. This was the lamb that God promised Abraham he would provide (Gen. 22:8), which was symbolized at Passover ( John 19:36), and was prophesied of Jesus (Is 53:7). Jesus was the lamb that God said he would provide.
This testimony culminated at the baptism of Jesus, when John beheld the descent of the Spirit, which confirmed a prophecy that he had been given as a key part of his own ministry. This was indeed the Son of God. John doesn’t describe the actual baptism of Jesus, but he does provide us with the place where this happened.