I've got a couple of foot and pants peckers... All hens, too. They get me when I'm sitting on their old garden bench with them and they like a certain couple of old hikers I use as garden shoes and a specific type of pants I wear...the same gear I wear when whipper-snipping or lawn mowing. The whipper-snipping especially coats my shoes and pant legs with literally hundreds of tiny bits of grass and such which is probably lots of fun and tasty for the hens to pick off as it dries. This is likely what got the more 'normal' hens started... But I've also got an obsessive hen. She had her beak trimmed as a chick and needed some help to keep her lower mandible growing straight as her entire beak grew out as best it could as she matured. Well, her lower mandible still protrudes and always will, but she deals with it very well and self-trims nicely now by driving her beak into the ground HARD at times, which really helps blunt the excess back. She's also the one who likes to peck my shoes and pants HARD--I think there's something about the texture of them which keeps her going long past any possibility of picking up any actual whipper-snip tidbits. She's a friendly thing. Once done with my shoes and legs, she'll usually hop up and climb onto one of my thighs to have a grooming session and relax for a few minutes. I think she has some dim awareness that my trimming her beak with clippers back when she was just a chicklet and then a pullet was always followed by her finding it easier to peck and pick up food afterwards, hence my handling her was a good thing to be tolerated.
Anyway, hens with formerly clipped beaks which are still a little messed up...I think they're inclined to sometimes peck a lot just to be pecking. The rest, I think they peck mainly for food and to try and teach you to feed them treats or just pay attention to them.