The first sentence indicates that there was no food left for the subjects. Thus, we can say that the objects had finished eating all the food. Also, an event of the past is being discussed here(the word 'left' indicates past). Thus, the answer must indicate an action that has been completed with respect to the past. This, means that the answer must be in past perfect tense.
Option A is incorrect. 'will eat' is in the future tense and not the past perfect tense. Thus, it does not have the required tense and is incorrect.
Option B is correct. 'had eaten' is in the past perfect tense and thus, indicates an action that has been completed with respect to the past. Thus, it is the correct answer.
Option C is incorrect. 'ate' is in the simple past tense and not the past perfect tense. Thus, it does not have the required tense and is incorrect.
Option D is incorrect. 'have eaten' is in the present perfect tense and not the past perfect tense. Thus, it does not have the required tense and is incorrect.