A room affects the sound of a speaker by the reflections it causes. Some frequencies will be reinforced, others suppressed, thus altering the character of the sound. This is a major reason loudspeaker designers test their creations in such an environment, not wanting their design decisions to be influenced by the colorations of any given room. The real world, however, requires that our speakers co-occupy our living quarters, therefore we must deal with the room as a significant contributing factor. In any listening environment, what we hear is a result of a mixture of both the direct and reflected sounds.
Direct sound travels straight to our ears from the speaker diaphragms.
Reflected sounds are many, bouncing off most any hard surface and reaching our ears after the direct sound. On to specifics. Distance to side wall and back wall. Distance to reflective surfaces, speaker radiation pattern and toe-in all contribute to the amount and intensity of early reflections. Differences among speakers can also influence positioning.