As a summer camp counselor, I took groups of kids, ages 10 and up, on backpacking trips in Yosemite (Glacier Point to camp in Little Yosemite Valley, then up Half Dome as a day hike, then down the Mist Trail past the various waterfalls). I would do that hike with younger children, but probably not younger than 8.
That said, I think 5-year-olds can have a great time doing the Junior Ranger activities, less-strenuous hikes and other activities. When my daughter was that age, she did the Junior Ranger program at California's state park at Sutter's Mill, and once she was sworn in as a Junior Ranger, she walked out of the park office and started picking up trash, since she had just promised to protect the park

. I also found that giving her a camera of her own was a great motivator on a hike, although that sometimes slowed us down as she took pictures of every. single. wildflower.
There are ranger programs that cover a range of interests -- such as a kid-accessible slide show on the geology of the Grand Canyon, star gazing on the beach in Acadia, etc. I think a national park can be a great family vacation, just manage your own expectations for how much mileage you do...