After these things came Jesus and His disciples into the land of Judaea; and there He tarried with them, and baptized.
And John also was baptizing in Aenon near to Salim, because there was much water there: and they came, and were baptized.
For John was not yet cast into prison.
Jesus and His disciples had traveled south into Judaeah (Judea), where they stayed for a time. He preached and taught and baptized there.
In the meantime, John the Baptist was still working just south of the Sea of Galilee, where there was plenty of water, and was baptizing people there. The exact location of this place is arguable, but it isn’t the place as much as the work he did that is important.
He had not been arrested and imprisoned yet, but the time was drawing near.
I’ve often wondered if John knew his time on earth would be short; if he was aware that prison awaited him, and probable execution. Perhaps he was so zealous because he did understand that his time was short, but that’s just supposition on my part.
In any event, these three verses serve as a transition from the beginning of Jesus’ public ministry near His home town of Nazareth, to the more southern reaches of Israel where He spent a great deal of time.
The Gospel of John focuses on Jesus’ work in Judea, while the synoptic gospels tend to talk more about His work near Galilee. This is not a contradiction; it is simply a difference of focus because of John’s presentation of Jesus Christ as the Son of God.