The process that gives rise to an immune complex. Immune complexes are clusters of antibodies bound to antigen, to which complement may also be fixed, and which may precipitate or remain in solution. Examples are the clumping of cells such as bacteria or red blood cells in the presence of an antibody, precipitation of a toxin after an antibody binds to it, and clumping of viral particles as a result of antibody binding to the virus.