When a second-order phase transition is crossed at fine rate, the evolution of the system stops being adiabatic as a result of the critical slowing down in the neighborhood of the critical point. In systems with a topologically nontrivial vacuum manifold, disparate local choices of the ground state lead to the formation of topological defects. The universality class of the transition imprints a signature on the resulting density of topological defects: It obeys a power law in the quench rate, with an exponent dictated by a combination of the critical exponents of the transition. In inhomogeneous systems the situation is more complicated, as the spontaneous symmetry breaking competes with bias caused by the influence of the nearby regions that already chose the new vacuum. As a result, the choice of the broken symmetry vacuum may be inherited from the neighboring regions that have already entered the new phase. This competition between the inherited and spontaneous symmetry breaking enhances the role of causality, as the defect formation is restricted to a fraction of the system where the front velocity surpasses the relevant sound velocity and phase transition remains effectively homogeneous. As a consequence, the overall number of topological defects can be substantially suppressed. When the fraction of the system is small, the resulting total number of defects is still given by a power law related to the universality class of the transition, but exhibits a more pronounced dependence on the quench rate. This enhanced dependence complicates the analysis but may also facilitate experimental test of defect formation theories.