There's a little more to it. Approximately half of the daily quota for a particular day is reservable in advance, but that varies by the trail. That leaves approximately half of the daily quota for a first-come basis. However, the first-come part opens up at 10 a.m. the day before the entry date. Also, you need to go to the correct permit station, not some one halfway across the park.
So, if you were silly, you would show up on a holiday weekend, and you would want to backpack on one of the most popular trails. Due to what is reserved, plus what got taken at 10 a.m. the day before, there might be nothing left in the quota for you. This really angers some visitors.
If you are smart, you try to reserve something in advance, which costs $5 per person plus $5. Or, if you just show up and want to get a permit, try to do it mid-week and especially away from holidays. Try to get a permit for one of the obscure trails to seldom-visited parts of the park. If you get a permit without benefit of a reservation, they are free, but you just can't count on them within the quota. If you are standing in line when the permit station opens of a morning, you stand to score more. But they won't issue tomorrow's permit until 10 a.m. today. If you want to get a permit for one or two backpackers, it is a lot easier than trying for eight or ten.
When you first start to get a permit, it is smart to have a primary trail and a secondary trail in mind, just to make sure that you will get in a quota.
Be prepared to show your bear canister when you pick up your permit. They didn't use to check, but now they do.
The whole quota system is based on the trailhead entry points, plus a little about your destination for the first night. Once you get ten miles away from the roads, hardly anybody cares.
–B.G.–