When you lock the 3D cursor with the lock button, it stays where it is even if you perform an operation that moves the 3D cursor.
Starting scene demonstrated on Suzanne
Steps
Set "3D Cursor Lock Runtime" to "On" in "Always-on Toggles".
Click the lock button that appeared in the bar at the top of the 3D Viewport.
Select Suzanne and click "Cursor To Sel" in "Transform".
Click the lock button again to release the lock, then click "Cursor To Sel".
Follow the changes on screen
BeforeThe 3D cursor is on the left and Suzanne is on the right. The lock button is shown in the bar at the top.LockedAfter clicking the lock button and then "Cursor To Sel". The 3D cursor remains on the left.UnlockAfter releasing the lock with the lock button and then clicking "Cursor To Sel". The 3D cursor has moved to Suzanne.