The light pulse spreads out in all directions, traveling at the speed of light. You can think of the light pulse as an expanding shell of light energy. The original light energy in that 1-second pulse is spread over an ever enlarging shell. Intensity is the light energy that strikes 1 square cm in one second. As the shell expands, there is less light energy available for each square cm on the shell.
Light intensity decreases as the distance squared.
All other things being equal, a light source 3 times more distant is 9 times as faint. Instead of comparing the intensities and magnitudes of two different stars, we will compare the intensities and magnitudes of the same star at two different distances. Once we know the distance modulus, we can easily calculate the distance to the object. Assuming no other factors are involved, we now have the explicit relationship between apparent magnitude, absolute magnitude, and distance. Knowing any two allows us to solve for the third.