Software development is difficult, for years the traditional Waterfall method that a lot of organisation used for large systems failed them. The requirements would be given, then software architecture, implementation, testing of the system and finally the maintenance phase.
All this up front assumed that the requirements wouldn't change, the design wouldn't change which would then causes further delays to the implementation which in turn would further require re-testing.
If there's one constant in life and software is that change will happen. Xp attempts to make that change less painful.

Smaller iterations with a higher feedback loop whilst concentrating on
the simplest solution that fulfils the requirement. Everything else can be added later. This in a wider sense is what "You aren't gonna need it" (YAGNI) is.
This I have to admit I find at times can be difficult to convince a client when they're giving you their wish list that contains everything but the kitchen sink. You as a responsible developer has to push back by asking them if they really need it for the first release. Because if you don't, then you're the one in trouble because you promised too much.

The smallest thing that will work means the software is more likely to be developed on time. The code is not trying to predict that future by increase complexity early. And it communicates clearly to the other team members, as simple code is easier to understand.