These are discussed in section 5 of the Tech Ref. The notes below are all covered in Tech Ref but in a slightly different order. You may find these useful.
Imagine a simple case where you want to use some form of soft-restraint to keep a coordinate x1 close to a particular fractional coordinate, e.g. close to 0.137. Here 0.137 represents an “expected value”.
Don’t get too confused by the terms “penalty” and “restraint”. They both try to steer the refinement towards a solution that is consistent with a non-diffraction based observation (e.g. here for some reason you expect x1 to be close to 0.137; more commonly you expect bond distances or angles to have certain values), or some condition such as non-overlap of atoms or an energetically sensible configuration (e.g. Topas anti_bump or grs_interaction).