You’re missing the point. Look at the two links again. Popik says earliest usage is 1909. But, Society for History New York shows a usage in 1907 that makes the same tree & sap analogy as Popik’s 1909 cite.
The 1907 cite:
The term “Big Apple” or “The Apple” had already passed into general use as a sobriquet for New York City by 1907, when one guidebook included the comment, "Some may think the Apple is losing some of its sap."
Apples don’t contain sap. Trees do. So, the author seems to be referring an anology (of America as an apple tree) that he assumes is common to the reader - one that is precisely along the lines of Popik’s 1909 cite:
In The City in Slang: New York Life and Popular Speech (1993), Irving Lewis Allen quotes a 1909 comment by one Martin Wayfarer: "New York [was] merely one of the fruits of that great tree whose roots go down in the Mississippi Valley, and whose branches spread from one ocean to the other… [But] the big apple [New York] gets a disproportionate share of the national sap."
ERGO, it is likely that this idea, about NYC being the biggest apple & getting most of the national tree’s sap, was probably used earlier elsewhere in an (as yet unknown) article (or editorial cartoon or speech or popular cliché or something) to which both the 1907 & 1909 authors were restating for effect.
Q.E.D.
To say that it is a racing term - still begs the question, why an apple? And, not, for example: “the big cigar” or “the big trophy” or “the big check”, “the brass ring”, etc.? Did horses get big apples right after races??? Or, was winning there the biggest prize money & therefore just the sweetest & highest priced apple in the barrel? I don’t know. An apple on a tree makes more sense.
“Big Apple” implies a comparison to others - like a top prize or the one that gets the most attention or the most fertile ground or perhaps hardest to get - like a really big apple seen from the ground all the way at the top of the tree, just out of reach.
I don’t find the sexual reference particularly convincing. But, note the 1892 quote by William Jenning Bryan’s campaign speech (in the Society for History New York piece). WJB branded NYC as “the foulest Rotten Apple on the Tree of decadent Federalism.”
The apple analogy here may be coincidental, but note that it’s the worst “Rotten Apple on the Tree” rather than a rotten apple in the barrel - perhaps also drawing on this older country-as-fruit-tree-with-different-fruits idea. (I suspect somewhere there’s a 19th drawing of America as apple tree which became popularly invoked imagery - perhaps with different state branches joined together by the federal trunk - much like Franklin’s “Join or Die” snake in the 1770s.) WJB may have been invoking someone else’s orinally postive imagery in his speech - and turning it around for effect. Trees don’t usually have rotten apples, nor is it the tree that makes an apple rotten, nor does one rotten apple affect the others as in the cliché about the barrel.
This ties in with what Cecil says elsewhere:
The etymology of “Big Apple,” sad to say, lacks the classic clarity of the answer to the first part of your question. Of the many theories advanced, the most reasonable seems to be that the phrase originated in show-biz circles. “There are many apples on the tree,” an old saying supposedly runs, “but only one Big Apple.” So vaudevillians, jazzmen, and other wormy entertainment types dubbed New York, the most important performing venue of them all, the Big Apple.
Again, the image is of people scrambling up a tree to grab for themselves the biggest apple at the top. The horse racing explanation just doesn’t explain why it’s an apple, at all. (Except, I guess, that that might be considered what horse might like most to eat???)