For the first statement, it is generally true that when a car is far away, its headlights appear brighter than when the car passes you. This is because the headlights are focused in a narrower beam when the car is far away, which makes them appear brighter. As the car approaches and passes you, the beam of light is spread out over a wider area, making it appear dimmer.
For the second statement, it is generally true that the apparent brightness of a star is lower the farther away it is from Earth. This is due to the inverse square law of light propagation, which states that the intensity of light decreases with the square of the distance from the source. So, as a star gets farther away from Earth, its light has to travel a greater distance, and therefore spreads out over a larger area, making it appear dimmer.