Basically, the item making the impression has to last long enough for more sediment (and it's almost always sediment suspended in water settling out) to cover it. The weight of the overlying sediment both makes the impression and starts the process of compressing the impressed material into rock. And yes, 99.99% of the time, the impression doesn't last. But 0.01% of millions of impressions made by various things over the millennia is still a pretty hefty amount.