Explain this common observation clearly

Explain this common observation clearly. If you look out of the window of a fast moving train, the nearby trees, houses etc. seem to move rapidly in a direction opposite to the train’s motion, but the distant, objects (hill topes, the moon, the stars etc.) seem to be stationary (In fact, since you are aware that you are moving, these distant objects seem to move with you).

The line joining the object to the eye is line of sight. If we move rapidly, the line of sight nearby tree changes its direction of motion rapidly. It means near objects make greater angle than distant objects. Thus, the trees appear to run in opposite direction. But in case of moon, stars etc., this change is negligible, so they appear stationary