The phenomenon you are referring to is known as the observer effect in quantum mechanics. It states that the act of observing a particle, such as an electron, can influence its behavior. However, this effect is limited to the microscopic world and does not directly translate to larger scale objects like distant galaxies.
In the quantum realm, particles like electrons can exhibit wave-particle duality, meaning they can behave both as particles and waves. When you try to observe them, say by using photons (particles of light) to "see" the electron, the interaction between the electron and the photons can cause changes in the electron's behavior. This effect is fundamental to the nature of quantum mechanics and is well-established through experiments.
On the other hand, macroscopic objects, such as distant galaxies, do not exhibit the same quantum behavior as subatomic particles like electrons. The observer effect does not apply to such large-scale objects. These galaxies are governed by classical physics and general relativity, and they don't display the peculiarities of quantum mechanics.
When astronomers study distant galaxies, their observations are not directly influencing the behavior of those galaxies. Rather, they are gathering light and other electromagnetic radiation emitted by the galaxies, which is used to infer properties such as distance, composition, motion, and so on. The act of observation in this context doesn't change the behavior of the galaxies themselves.
In summary, the observer effect is a unique property of the quantum world and doesn't have any significant impact on larger-scale objects like galaxies. Astronomers can study galaxies without affecting their behavior through observation.