The gemara Shabbos 47b says that even on Erev Shabbos one may not place a vessel with water in it under a candle in order that any sparks emitted by the flame should fall into the water, because it is a form of extinguishing a fire. Yet many homes put water underneath the oil in their Shabbos candles, using either fixed wicks as in the picture below or floating wicks, even though we see that when the oil is nearly finished the flame sputters and goes out, and so clearly the water is extinguishing the flame. Why is this permitted?
Aruch HaShulchan 265:12 & 265:13 discusses this. From what I understand the Gemara is talking about placing a bowl of water under the candle where it would be prohibited even from Erev Shabbos, however oil with water in a glass is no issue.
Orach Chaim 265:4 says that so long one has no intention that it is being done to extinguish the flame sooner it is permitted. The Rama cites authorities who allow adding water even if it is being done with the intention of having the fire extinguish sooner, since it is being done indirectly. From DailyHalacha.com
This issue is discussed at length in Maseches Beitzah (22a, see Tos. s.v. hamistapek and the Rosh there). The bottom line is that if the water is there before Shabbos, it is not a problem, and the case of the bowl of water (of the gemara you referenced) is where the bowl was placed next to the candle to catch the sparks so that they not cause burns, and Chazal were worried you would lift the bowl up to catch the sparks faster which would be causing extinguishing on Shabbos itself.
The Tosfos on the quoted gemara addresses this question, and explains that the difference is in the person's intention:
In the case of the gemara the person's intention is that the sparks from the flame be extinguished, and therefore Chazal prohibited the action even on Erev Shabbos as a safeguard against actively extinguishing the sparks with water on Shabbos since this is in line with his intention. But in the case of placing water underneath the oil the person's intention is to raise up the level of the oil, and therefore there is no reason to disallow it on Erev Shabbos as a safeguard against extinguishing on Shabbos, since this is not the person's intention.
The Gemara is talking about a case of מלאכה שיש צריכה לגופה. Even tho the person didn't do a מעשה on shabbat, because the candle gets extinguished on its own. I'm not sure the exact reason why they were gozer it. Since it's on "auto pilot." However if you have a case where it would be a מלאכה שאין צריכה לגופה then it is Mutar lchatchilah because the רבנן don't make a גזירה on a גדר. Not to mention that all this is through a GRAMA because the regular way of extinguishing is pouring water on a flame. In This case you have a lit candle that will slowly over time meet the water.