Jesus' brothers encourage Him to go to the feast, not really believing in Him yet. They want more proof and public action. Jesus demurs, but goes privately later.
When He teaches, the Jews are divided over Him. He asserts He is from God and that doing good on the Sabbath is fine (you circumcise on the Sabbath, following Moses, after all). There is no answer from the authorities, so the people wonder if He's the Messiah. But they think they aren't supposed to know where Messiah comes from, and they know He's from Galilee. Jesus responds that they don't know the one who sent Him.
They send to arrest Him, but the officers listen to Jesus and return without Him. He claims to be the water we need. (On the last day of this feast there was a ceremony of pouring water by the altar.) Some think He's the Messiah, others say Messiah is supposed to come from Bethlehem, and He's from Galilee! The rulers get mad at the officers who return without Jesus. They curse the crowd. Nicodemus objects, and they shout him down with prejudice against Galilee - no prophet will come from there. Nathanael was smarter than this (John 1:46-49).
Be careful seeking public vindication of Jesus before He says it's time - vss 1-9.
People are divided about Jesus, and have wrong ideas about Him - vss 10-31.
He is the source of what we need, not the traditions that comfort us a little - vss 37-39.