Apparent magnitude is simply how bright a star appears in the night sky.
But, the brightness of a star depends on its distance from Earth and its luminosity – how much power it produces. (A dim star could just be very far away, or very close but not very luminous).
Absolute magnitude enables us to compare the brightness of stars because it is a measure of how bright they would appear if they were all the same distance from the Earth. – 32.6 light years.