This is a very good picture representing an IUI.
An IUI bypasses the potentially lethal trip up through the birth canal and uterus. The mucous there can be harmful to sperm (containing attacking antibodies or by being too acidic) or not present in enough quanities for sperm to have a good medium in which to travel (Clomid is known to dry it up). The sperm is deposited near the top of the uterus, right next to the openings into the fallopian tubes. The sperm must then travel up the tubes, meet (or wait for) the just released egg, fertilize the egg in time for the egg’s decent into the uterus where it has just hours to implant itself into the uterine wall.
Failure can result if the sperm die before an egg is released, the IUI takes place after the egg has already left the tube, the sperm and egg fail to merge or merge correctly or the embryo fails to implant well into the uterine wall. I have heard that a perfectly timed IUI with a good quality egg and good quality sperm has only a 40% chance of fertilizing correctly and implanting well enough to be a sustainable pregnancy.