This is super frustrating feature that I can't overcome. I often want to align one object to another, without moving the one I'm aligning to. I've tried selection, key object but it keeps moving both elements.
Once you've selected the objects you want to align, click on the object you want to align relative to again. You'll notice that object gets a thicker outline—it is now the "Key Object". You'll notice the "Align to" button in the Align panel also changed to a key icon.
You can also just change the "Align To" in the Align panel to "Align to Key Object" and it will automatically set the top object to be the key, although you can click another object in the selection to change.
As long as you see that key icon, whichever object is the key object will not move.
You can read more here: Illustrator Help — Align or distribute relative to a key object
2Is there anyway to make it so Illustrator ALWAYS thinks the first selected object is the "Key Object", regardless of top/bottom order of objects in the layer(s)?– ConfusedSep 16, 2016 at 17:30
1From the docs: "you don’t need to hold down Shift as you click this time" Sep 19, 2018 at 14:56
Just found out that with Shift a multiple selection is made and with CTRL+Click the Key Object is selected within the already selected set of objects (with "Align to Key" option set in the alignment toolbox). Aug 10, 2021 at 11:18
Select two objects From Align panel choose
Further reading How to align all objects in the center of the artboard using Illustrator?