From the make of the sentence, it is evident that a word is required that means 'aggravated her problem by...'
From the options, ‘compound’ means 'to make something worse' or 'intensify the problem', it seems relevant to the sentence, meaning this: the builder worsened her problem by not building a boundary wall.
Option A: 'compound' is the base verb, in order to be used in the sentence, it requires either the preposition 'to' or the present tense form: compounds. Since neither is the situation, option A is incorrect.
Option B: when 'compounded' is placed in the sentence, it matches in tense and meaning; the word is in simple past tense, hence requires no helping verb (auxiliary) nor an infinitive 'to'. Hence option B is correct.
Option C: 'compounding' is a present participle, it requires an auxiliary verb (is, has been, was, etc.) to express a suitable tense (present continuous, present perfect continuous, past continuous, etc.). No auxiliary verb is present in the sentence. Hence it is evident that this form of the verb isn't required and C is incorrect.
Option D: 'comprehend' means 'to grasp mentally'; the meaning does not relate to the sentence; it gives the meaning that the builder understood her problem by not building a boundary wall (this meaning is conflicting). Moreover, this is the base form and does not express the tense of the sentence. Hence D is incorrect.