From Reddit: expression “how do you like them apples” is often used as a way to mock or tease someone after gaining some kind of victory over them, or after they receive surprising information.
Numerous online sources suggest the expression comes from World War I. The word “apple” was a nickname for certain grenades and mortars that were used in trench warfare at the time. For instance, there was a 2 inch medium trench mortar that was nicknamed “toffee apple” because it looked like an apple on a stick.
However, according to the Early Sports and Pop Culture History Blog, the expression was used before the First World War, dating back to at least the year 1895. For example, it appears in the newspaper The Eagle, September 26, 1895:
“Bryan is the best cotton market in this section of the state and has received more cotton than any other town in this section. How do you like them apples?'”