The function of the rugae is to allow the stomach and other tissue to expand as needed to assist in the digestion of food. WebMD defines gastric rugae as ridges of muscle tissue lining the stomach.
Gastric rugae are essential to the body's digestive system, as stated by Wikipedia. Gastric rugae are folded in the stomach tissue when the stomach is not full. When the stomach is full, the rugae unfold, which allows the stomach to expand. When the stomach empties, the rugae unfold, and the stomach goes back to its original size. Gastric rugae are evident only when a tissue or organ is deflated or relaxed and can be seen in radiological studies. They increase the surface area of the stomach to allow for more nutrient absorption. They also allow expansion in the volume of the stomach without increased pressure.
Wikipedia notes that rugae are located in other parts of the body. They are found in the wrinkles of the scrotum in males and in the vagina in females. They are also found in the hard palate, which is located directly behind the upper anterior teeth. The gall bladder and the inside of the urinary bladder also contain rugae.