Article 2, section 2 of the US Constitution gives the President the power anyone, at anytime, for any crime.
and he shall have Power to Grant Reprieves and Pardons for Offenses against the United States, except in Cases of Impeachment.
As to why the pardons go out and what started the mass pardons at the end of the year, I honestly dont know the answer to that.
As to who they go to, people can petition the President for pardons, and the President and his staff go thru the petitions and make their decision.
What criteria they use to make those decisions, I dont know.