Primary tumors form when genetic mutations occur in the DNA of normal cells, causing them to grow and divide rapidly. These mutations can be triggered by a variety of factors including exposure to carcinogens, such as tobacco smoke or ultraviolet radiation, genetic predispositions, or viral infections.