Apparently they had one of the longest and strictest lockdowns in the world. Curfews, not allowed to leave the house at all on Sundays, shops (even grocery stores) on limited opening hours, mandatory masks...
And one of the highest death rates in the world now. Excess deaths at 149% compared to Brazil (seen as a failure in the media due to their less strict locking down) who have only 20% excess deaths.
Why? There doesn't seem to be any particular reason why some countries get a lot of coronavirus and death and some countries get only a little. The strongest link to excess deaths seemed to be obesity but Brazil is a fatter nation than Peru...