• Whoever is the subject of the verb “did”. Whoever did something.

    Whomever is an object, so whoever did something to whomever.

    In other words, “whoever” does things; “whomever” has things done to them.