PIDs are primarily caused by genetic mutations. These mutations can affect various components of the immune system, including T cells, B cells, phagocytes, and complement proteins. The mode of inheritance can be autosomal dominant, autosomal recessive, or X-linked.