The condition is caused by mutations in the genes that encode for clotting factors, specifically factor VIII (Hemophilia A) or factor IX (Hemophilia B). These mutations lead to a deficiency or dysfunction of these clotting factors, which are essential for the blood clotting process.