There are several physical conditions of the uterus which can cause miscarriage and infertility. Obviously, if for whatever reason the uterus is not a welcoming environment an embryo cannot implant or will not implant correctly.
Some of these problems result from a uterus which is malformed. These malformations can be a result of random congenital defects or exposure to DES (diethylstilbestrol). DES was a drug frequently given to pregnant women in the 1950's and 1960's to prevent miscarriages. While it did seem to prevent miscarriages, it also, ironically caused birth defects in the babies whose mothers took the drug. These birth defects went on to affect their fertility as adults. There are several types or classes of uterine malformations, depending on the shape of the uterus. These problems can be diagnosed with ultrasound. Sometimes surgery can be used to modify the shape of a malformed uterus.
Another type of problem is uterine fibroids. These are benign fibrous growths in the uterus. The may cause bleeding or pelvic pain or may have no symptoms at all. For many women, they aren't problematic at all. However they can also be the cause of recurrent miscarriages depending on their type and location. Again, surgery can generally correct the problem.
Endometriosis is another condition which can cause miscarriage and infertility. In endometriosis, according to Wikipedia, the endometrial cells (cells that normally line the uterus) proliferate outside of the uterus. This can cause adhesions, scar tissue and can cause the uterus to become mis-shapen. This is a more painful and serious condition that the previously mentioned fibroids. There is no cure for the condition but as with the others, surgery may reduce pain and help facilitate a healthy pregnancy.
Asherman's Syndrome is a condition where adhesions or scar tissue form inside the uterus. Damaged tissue can actually fuse together according the the Asherman Online Community's website. Pelvic surgery and infections can cause this condition but it seems that many of the cases are related to D& C procedures or previous miscariages. This is a case of miscarriages actually causing additional miscarriages. Hysteroscopy is the surgery recommended to treat this condition.
Any time there are abnormal formations in or of the uterus, fertility is compromised and miscarriage is a possibility. Some of these conditions may not have any symptoms, so you and your doctor may not suspect that they are the cause of your miscarriages. However, most can now be diagnosed with ultrasound and many can be surgically treated.