Great thread! Great question. Here’s my simpleton take:
The sound from your speakers bounces all over the place, like light in a mirrored room. When speakers are near back and/or side walls, the sound off the wall comes back to yours ears so fast that the reflected sound interferes with the sound coming from your speakers. Moving the speakers into the room lets you hear more sound from your speakers, less of the reflected sound from the walls. Moving the speakers into the room can also actually help the reflected sound improve the sound of your speakers.
Even a couple inches change in speaker placement can have outsized changes in sound quality. Experimenting with placement is a lot of fun…