Cells lining the womb set an "entrance exam" that decides whether or not to allow an embryo to take up residence, research has shown.
Scientists hope the discovery will prove to be a milestone in the development of new pregnancy treatments.
An early stage embryo can develop into a foetus and baby only if it successfully implants into the soft lining of the womb.
Implantation failure is a major cause of miscarriages, yet many aspects of it remain a mystery.
The new research sheds light on a biological quality control system that allows the womb to assess the suitability of a newly fertilised egg.
Researchers found high-quality embryos secrete a chemical called trypsin that produces a reaction in the womb lining, rendering it supportive of implantation.
In low-quality embryos with a high proportion of abnormal cells, the chemical's absence triggers an alarm response in the womb that results in rejection.
When the system goes wrong it can lead to good embryos being lost, or bad ones being kept.
Study leader Professor Jan Brosens, from the University of Warwick, said: "This is important, because if the lining of the womb is not well prepared for pregnancy you may find that abnormal embryos will implant or high-quality embryos will not be supported.
"Both scenarios can lead to pregnancy loss or even late pregnancy complications, such as foetal growth restriction or pre-term birth.
"Speaking in terms of an entrance exam; a poorly prepared womb will either make the test too rigorous or too lax - decreasing the chances of a successful pregnancy."
Around 15 per cent of pregnancies miscarry, according to the scientists whose findings appear in the journal Scientific Reports.
Co-author Professor Siobhan Quenby, also from the University of Warwick, said, "This work adds to a growing body of evidence that assessment and optimisation of the lining of the womb may be the only effective way in preventing infertility and pregnancy complications."
The team believes its research could be vital to improving IVF success rates, because lack of embryo implantation is the primary cause of treatment failure.
"What we're looking at now is how to alter the lining of the womb so it can set this entrance exam at the right level and prevent implantation failure and miscarriages," Professor Brosens added.
