Equalization of accrued gains (Zugewinnausgleich)
Spouses, that are married under German law live under the property regime of community of accrued gains (Zugewinngemeinschaft) the gains accrued during the time of marriage (except from donations and inheritances) are equalized when the community of accrued gains ends (e.g. by death or by judgment). This is called equalization of accrued gains (Zugewinnausgleich). A gift or inheritance does not increase the value of a spouses assets for calculation of the other spouses equalization claim. However, the appreciation in value of a gifted or inherited assets will be considered. A calculator is available here: https://www.lawyerdb.de/Accrued_Gains.aspx
In case of intestate succession (gesetzliche Erbfolge), the gains are equalized by augmenting the intestate share of the surviving spouse by ¼ of the estate. See § 1371 BGB.
What is received as equalization of surplus is not subject to German inheritance tax. See § 5 ErbStG.