The optimize button finds the parameters that result in the lowest root-mean-square error (RMS). In kriging, for a given semivariogram type that you choose (Stable, Exponential, etc), it will optimize the range, nugget, and partial sill to find the lowest RMS. If anisotropy is turned on, it will also find the optimal direction and major/minor semiaxes.