Are entrance fees for cars only? Can backpackers walk through a park without paying?
Usually these fees are for multiple days. For Yosemite: car fee is valid for a week(there are other deals if you want to stay for longer or visit multiple times an year). The wilderness permit... I don't really know. You do have to submit start and end dates for each trip, but the fee covers the duration.
EDIT:
Also Yosemite: it appears that foot traffic is charged too. https://www.nps.gov/yose/planyourvisit/fees.htm
That highly depends on the park.