Complement fixation occurs when an antigen-antibody reaction leads to the formation of a heterogeneous phase, such as red cells, bacteria, or a precipitate.