Both "compare" and "compared" are verbs, but "compared" is either the simple past tense or the -past participle form. In your example, you're using "when" before the verb, so then we use the past participle form. For example, "People when seen from an airplane look very small." Here the verb is "see," the simple past is "saw" and the past participle is "seen." Because we have "when," we use the "seen" form of the verb.