Anorectal malformation is a birth defect that affects the anus and rectum. It occurs when the rectum and anal opening do not develop properly, preventing bowel movements from happening normally. The condition requires surgical correction soon after birth to allow stool to pass through the anus and rectum.