Wrt CPU: The cycles per instruction measures were entirely predictable with 386 and 486 chips, and more-or-less so with early Pentiums, you just need a delay loop so the faster ones didn't speed ahead of the lowest you were targetting. While there was a significant range to deal with, it was predictable. A 4K demo is going to fix in a 486's on-board cache (which I don't think was ever less than 8Kb aside from some relatively rare clone models), so DRAM speed, L2 cache and other motherboard variances, are not significant in those cases either.
Wrt GFX: Most demos, certainly when thinking about the 4K challenges, would be using nothing more than some variant of a basic VGA display mode (usually but not always Mode 13h or some variant like “Mode X”) without detecting and taking advantage of acceleration features - the difference between graphics cards at this point was not nearly as significant as what the demos were doing in the CPU, even the nastiest ISA card of the era is going to keep up at a reasonable framerate, IIRC from my doom playing days.