We know that both the pill and the IUD prevent the sperm from reaching the oocyte - anyone who practices natural family planning understands the significance of the thickened cervical mucus due to the progesterone surge after ovulation.
Reference: experiments done by Croxatto and by Durand.
However, I don’t advise IUD’s because they can also interfere with implantation and with development of the child.
(And, BTW, The women who take progesterone to support early pregnancies understand how progesterone works to improve the chances of implantation and continuation of the pregnancy.)
You are correct about the role of mucose production. There are two methods used by IUDs sold in the United States. One way is by the encouragement of Mucuse production to create a barrior to the sperm. This is the method of the Mirena IUD which secretes progestin for this purpose. The Mirena IUD provides double protection against pregnancy because it also affects the lining of the uterus to prevent implantation of a fertilized egg. The copper ParaGard IUD does not have hormones. It works by activating enzymes in the lining of the uterus, which prevents the implantation of an egg.