Here's why:
* Adverbs modify verbs, adjectives, or other adverbs. They tell us how, when, where, or to what extent something happens.
* Scarcely modifies the verb "was" by indicating the extent to which there was candy left. It tells us that there was very little candy left.