At the Feast of Tabernacles, the people would go to Jerusalem to celebrate the time when God, through Moses, brought water from a rock in the desert. They would thank God for providing water in the past year and pray that he would do the same in the coming year. The water was also seen as a sign of God’s favour and a symbol of spiritual refreshment (see, for instance, 1 Corinthians 10:3–4).
It was on the last and greatest day of the Feast of Tabernacles that ‘Jesus stood up and proclaimed, “If any one thirst, let him come to me and drink. He who believes in me, as the scripture has said, ‘Out of his [innermost being] shall flow rivers of living water”’ (John 7:37–38, RSV). He was saying that these promises would not be fulfilled in a place, but in a person.
It is out of the innermost being of Jesus that the river of life will flow. Also, in a derivative sense, the streams of living water will flow from every Christian! (‘Whoever believes in me’, v.38). From you, Jesus says, this river will flow, bringing life, fruitfulness and healing to others.
This picture is picked up again in the book of Revelation, where we see fulfilment of the city of Jerusalem (Revelation 22:1–3). Just as a river had flowed out of Eden at the very beginning of the Bible story (Genesis 2:10), so now at the end, in the new heaven and the earth, a river flows from this city of God, where God makes his home with humanity forever.