You read the clause. If it was properly written, it will tell
you exactly how the bonus/penalty is to be calculated. The contract
may even include examples.
In contractual terms, a penalty clause is specifically there to
encourage the other party to finish the contract, and to punish
that party if there is a breach. Penalty clauses are not calculated
with respect to a genuine estimate of the losses that will be
incurred by the contracting party. If there is a genuine attempt to
estimate damages, and you agree to them, it is called liquidated
damages. The courts will ignore a penalty clause because it is
unfair, and calculate the actual damage you cause the other
party.