Exactly what is SEO, and how does it work?

Search engine optimization is now more than two decades old, yet it’s still a mystery to the common marketer. We know we need it. We know it works, in theory. But what’s going on behind the scenes?