Salvation is a free gift. She did not know that. She had been brought up under a system of legalism. This becomes clear from what she says in vv. They do not see that true religion is a matter of the heart, not outward observances.
Legalism is in our blood.
We think we have to do something to earn salvation and we forget that God saves sinners freely. It is God s gift to us. Maybe you realize that you are a sinner and that you need a Saviour. Yet you cannot get it through your head that all God asks from you is to receive salvation from Him as a gift. If you knew this, Jesus says to this woman, you would ask.