Mindcrank has a triggered ability that triggers when an opponent loses life. When this trigger resolves the player that lost life that triggered the ability will then ‘mill’ cards equal to the amount of life lost.
There is reminder text on the card stating that damage caused by source without infect counts as loss of life and will cause this ability to trigger. It is important to note that many things that can trigger this ability. Anytime a player would pay life also counts as loss of life. Effects that set a players life total will trigger this ability as long as the new total is lower than the previous one. Similarily, when a player has their life total exchanged for with a lower total, this counts as loss of life.