What conditions must be satisfied in order for a court to consider that damages constitute a penalty?

The margin has to be considerable for a contractor to successfully argue that the damages are in fact a penalty, and secondly and more importantly the burden of proof remains with the contractor.