The inverse square law applies to true 'point sources' of light. If you look up illustrations, the light which fans out from a true point source expands outward in all directions, which is why the number of photons falling onto an object decreases by the square of the distance (inverse square).

When the distance to the source is close enough, inverse square does not apply...a softbox used within about 3x largest dimension of the softbox behaves closer to inverse linear. Similarly if you were 2.8 million kilometers from the 1.4 million kilometer diameter sun, the sun is a huge 'softbox'.

Reflected light behaves a bit differently since the object is not a true 'point source', but conceptually is a large collection of points on a surface. So its behavior is not 'inverse square' either.