They come from the atmosphere, since plants use carbon dioxide to produce carbohydrates :)
The fruit flys population would be less since the apples isn’t there anymore. The reasoning behind that is because it’s a fruit fly they like being around fruit.
This question is very broad, so one possible answer that's is also very broad is that they can form many other chemical compounds.