Here’s how the HomePod works its acoustic magic (extract from a Cult-of-Mac review):

Once you’ve chosen a good spot, HomePod does the rest. It takes a series of steps to perfectly adjust its sound output to accommodate the room it’s in.

Using its microphones, HomePod detects any nearby walls to determine how sound will bounce off them. It then uses its tweeters to form an array of sound beams assigned to direct and ambient sounds. The speaker shoots ambient sounds at the walls, and focuses direct sounds right at you.

When you play music, HomePod analyzes the left and right channels of your track and decides which sounds should go into which beams. It also measures the reflection of the bass from the subwoofer to ensure that the bottom end doesn’t take over your music.

Thanks to its accelerometer, HomePod knows when you move it, and it goes through this setup process again.