Many people think that standards are made to simplify and formalize certain formats or tasks. However most standards remain ambigous or “free to choose” in critical parts. This can happen due to political issues (several solutions exist and different companies want to bring in their own stuff) or due to simplicity (just use some other standard that already is ambiguous or disambiguation doesn’t pay off).
One fine example is PNG: The encoding process includes several options which allow for some tweaking. Color space and quantization for instance can be chosen by the encoder. If the encoder uses some standard quantization the encoding might result in a much larger file than needed. Another example is the deflate compression routine, where a trade off between expected file size and buffers can be made (larger buffers result in a higher compression rate but also in a larger memory consumption for decoding). More information can be found e.g. in A Guide to PNG optimization.
For those of you just wanting to optimize their PNGs here is a list of useful stuff: