The example that Abaye uses to explain the fact that we aren't concerned that money received from those outside the city would really be avoda zara money from inside the city even though they are in such close proximity, just as we aren't concerned that when a goy cooks treif near the pot of a Jew that he would make the Jews food treif.
Tosafos understands that gemara to be saying that in truth we are concerned that the goy will exchange the treif meat in his pot with the kosher meat in the Jews pot, just that we aren't concerned that the Jew will look in the other direction and provide the goy with the opportunity to do that. Tosafos clearly assumes that if the Jew would indeed turn away, even though he looks back and should qualify as יוצא ונכנס, the food would be assur. Based on this way of learning the gemara, Tosafos is bothered why יוצא ונכנס would not work here? Tosafos offers 2 approaches: 1. The concept of יוצא ונכנס isn't that it is unnecessary to have constant supervision. It is certainly necessary to have constant supervision, just that when the mashgiach pops in and out it creates a fear on the goy as if he were there the whole time. This only would work if the goy would be caught red handed by the Jew catching him, but if the goy would have a good excuse for what he is doing and claim that he is doing it for the benefit of the Jew, יוצא ונכנס would not work. Here too, we are speaking about a case where the goy would be able to claim that he is stirring the pot to help out the Jew and wouldn't get "caught like a thief". 2. Perhaps we are speaking about a situation where the food is not owned by the Jew, so the goy would not be stealing from the Jew if he were to switch the meat.
Nevertheless, Tosafos explains that the concern that a goy would swap the kosher for the treif only applies in a situation where he is benefiting from the switch. If he has nothing at all to gain, not money nor convenience, there isn't any concern that a goy would do something just to mess up the Jew. Tosafos proves this concept from a gemara 34b - קיסתא דמורייסא בלומא וקיסתא דחמרא בארבעה לומי - we aren't concerned that a goy would mix in some wine to the Jews food since it is more expensive that the actual food so he would have nothing to gain. Based on this Tosafos says that a Jew can leave their pots at home in the hands of their non-jewish housekeepers without fear that she would treif them up since she has nothing to gain (this would only apply if she has her own pots or equipment which she can cook with. Otherwise, the gain could be that she wanted a hot lunch and cooked it in the employers pot).
Tosafos seems to hold that even if there is no gain and no loss, the goy is not suspected of doing something just to mess up the kashrus of the Jew. However, the proof of Tosafos from the gemara later is from a case where there is an actual loss since wine is more expensive. Perhaps a goy wouldn't spend money to mess up the Jew, but when there is no loss he would do it just for the sake of messing up the Jew. How does Tosafos know that even if there is no loss, we aren't concerned that the goy will try to mess up the Jew? This question is asked by R. Shlomo Eiger (y.d. 118). In truth, the Rashba in a teshuva (cited by beis yosef y.d. 118) is only matir in a situation where it would cost the goy money to mess up the jew, but not where there is no loss. But, the Rosh (on our gemara) explains that if a goy would mess up a Jew's food even when there is no gain, he could have removed a very small amount of food and added a drop of wine which would virtually have not cost. From the fact that we aren't concerned even for a drop of wine added to the food, Tosafos and the Rosh deduce that a goy will not mess up a Jew for no good reason unless he would benefit in some way from the switch.