Deuteronomy 14:22 "You shall surely tithe all the produce of your seed"

After the first tithe was given to the Levites, a second tithe had to be separated.

In certain years (See Mitzvah 130), this portion was to be taken to Jerusalem and eaten there.

When a Jew would arrive in Jerusalem and behold the Beit HaMikdash and the many centers for learning Torah, he would be inspired and resolve to commit himself and family to a proper Torah lifestyle.

If for some reason the fruit cannot be brought to Jerusalem, he may "redeem" the fruits by setting aside their value plus an added fifth.

At a future date, when he comes to Jerusalem, he must spend that money in the city on food and drink.