The section of the Torah dealing with סוטה speaks of a woman who behaved in a manner which gave her husband reason to suspect her of adultery. The Torah gives us a miraculous way (see Ramban) of finding out whether the woman has had these suspected relations. If she sinned it would cause her death. However, if she was faithful, it would restore trust in the marriage.
However in order to go through this process there are certain things that must happen. The process is as follows: A married women and another man has been by themselves for sufficient name that they could have sinned (סתירה). However before this time, the husband had become suspicious about this man to have warned his wife not to be with this man (קינוי), but she ignored the warnings.
We now give the wife the opportunity to confess, due to the terrible end it would bring if she were guilty and were to drink the water. If she confesses, it would bring an end to the marriage, but she would not be punished because of the lack of evidence.
Theמים המאררים water was drawn from the כיור (the Temples' water basin) in an earthenware vessel. Rashi (quoting from Tractate Sotah) says the reason the water was taken with this nice vessel was to symbolize the goblets in to which she poured wine for her lover. Dirt from the Beit Hamikdash floor was then added to this potion. The Rambam comments that this would force her to acknowledge that she would die and return to the dust of the Earth.
The woman then takes a שבועה (an oath) which includes the results of both following and not following along with agreement. First the Kohen outlined the part if she is innocent. The Sphorno says that not only is she innocent for the accusations that her husband outlined, but also for taking this שבועה (oaths should not taken even if they are true). In this case she is responsible for having brought about the שבועה through loose behavior. The Kohen now outlines the results if the woman is guilty. He says נופלת ירכך (ה:כא). This is talking about the womb which will collapse because of the sin. The phrase is repeated in the next Pasuk to teach us that the same type of punishment will happen to the man with whom she sinned.
At this point the Kohen mixes the potion of water and dirt, and the Torah portion regarding Sotah is then written. These Psukim are the statements of the Shvua. These words are scratched off into the water (Hashem allows his name to be scratched off in order to bring peace between a man and his wife). The woman now drinks the potion, if she is guilty she will die. However, if she is innocent she will have children. Rashi says this means she will bear children more successfully. For example, if she had difficult labor she will give birth more easily. אבן עזרא says this means Hashem will give her a child to compensate for this ordeal.
The whole idea of סוטה was discontinued by the Sanhedrin during the Second Temple when it was felt that Bnei Yisrael were not worthy anymore of this direct infraction with Hashem.