The 6s2 lone-pair electrons (Pb2+, Bi3+) and 5s2 lone-pair electrons (Sn2+, Sb3+) show different responses to birefringence than they do to second harmonic generation (SHG). In the current work, different mechanisms of birefringence and SHG responses induced by Pb2+/Sn2+ cations were investigated using the first-principles method on AB2O3F2 (A = Ba, Sn, Pb). The obtained birefringence and SHG coefficients were in good agreement with the experimental values. The anisotropic lone-pair electron distribution was found at the states near the Fermi level containing cation sp-oxygen p states. Our analyses showed the birefringences of the AB2O3F2 (A = Ba, Sn, Pb) compounds to be directly affected by the anisotropic lone-pair electron distribution, however, the SHG responses of these three compounds have a more complicated relationship with the hybrid cation-oxygen states. The expanded hybrid cation-oxygen states including the lone-pair states were concluded to endow the PbB2O3F2 compound with a stronger SHG response than those displayed by the other compounds.