There are multiple ideas about the origins of this phrase, they range from religious to capital punishment. Read about the many ideas here . When it is used today it is generally meant to indicate that if you try a third time you will be successful.