The pencil skirt spent a good few years being quietly retired in favour of anything with elastic, and I think that was a fair trade at the time. The ones being made now have caught up with that complaint. There is more stretch woven into the fabric, the lengths have relaxed a little, and the whole shape has stopped pretending that sitting down is optional. It is a better piece of clothing than it was, though it still asks more of you than a lot of alternatives.
The difference between a good one and a disappointing one is almost entirely in what it is made of and how it is finished. A skirt with a bit of elastane in the weave, even five or ten per cent, will move with you and not bag out at the back of the knees by midday. Pure cotton or a stiff wool blend with no give will look sharper hanging up and will fight you all day in a chair. Check the lining too, a lined skirt in viscose or acetate sits better over tights and does not cling, while an unlined one in a thin fabric will show every seam of your underwear and ride up on its own. Look at the waistband next, it should have some structure to it, a bit of interfacing or a facing that sits flat rather than rolling, and the zip should be metal or a decent plastic set in straight, not puckering the seam. A kick pleat or vent at the back is not decorative, it is what lets you walk properly, and a skirt without one will either split a seam or force you into tiny steps all day.
Fit is where most pencil skirts go wrong, and it is nearly always at the hip to waist ratio rather than the length. Buy for your hips and have the waist taken in if you need to, because a skirt that is tight at the hip will crease horizontally across the front no matter what you do, and that crease never reads as fitted, it reads as too small. Sit down in it before you decide, properly sit, not perch, because that is the only real test of whether the vent is deep enough and the fabric has enough give. Watch the hem too, a pencil skirt that finishes right at the widest part of the calf makes legs look shorter, an inch above or a few inches below is kinder.
It is the wrong choice for a day that involves stairs, a bike, a toddler, or standing on public transport for any length of time, and it does not get on with chunky knits or anything cropped and boxy on top, which just doubles the narrow line and loses the waist entirely. It is a skirt for sitting at a desk or a table, not for a day that moves.