Piles occur when the veins in the rectum and anus become enlarged due to increased pressure. Common causes include chronic constipation, straining during bowel movements, sitting for long periods on the toilet, obesity, pregnancy, and a low-fibre diet. These swollen veins can be either internal or external, each type having its own set of symptoms and treatment methods.