Why elderly people like to pet kids hair?

I’m old, and I have no idea. I can’t figure out why old people do that, or force kids to kiss/hug them. It all seems pretty invasive to me. If kids want to kiss/hug them, that’s fine, of course.