Those bits are frass (caterpillar droppings) - undoubtedly from whatever lepidoptera (probably moth) had defoliated your apple tree. Just from the frass, I couldn't say which species if moth it might be.
Well the brown things on the floor are 'frass', which is a rather quaint name for caterpillar poo - so I think we know what defoliated your apple tree (nice crop of apples mind you). As to which species, well that’s more tricky. Given the size of the individual frass pellets it would have been a fairly large caterpillar/s - on apple I would suspect the Eyed Hawkmoth, Smerinthus ocellata, but that’s just a hunch.