Appendicitis occurs when the appendix becomes blocked, often by stool, a foreign body, or cancer. Blockage leads to increased pressure, problems with blood flow, and inflammation.