Received heat by radiation from the surroundings

In Stefan's law, the radiated energy of a black body with temperature $T$ is $q = \sigma T^4$ Where $\sigma$ is Stefan's constant.

However, if it is surrounded by a medium then the net radiated energy is $q = \sigma(T^4 -t^4)$ Where $t$ is the temperature of the surroundings.

So my question is, Why the energy received from the surrounding is $\sigma t^4$?

Even that air doesn't have definite area, volume..etc. why do we assume it follows Stefan's law?

But if you put any black body inside a container (which could be as large as the universe), there is radiation going out, and radiation coming back. The formula you give assumes that all of the surroundings are at the same temperature $t$; more realistically, you "see" a mixture of objects of different temperature, and receive "some" flux from each, proportional to the solid angle they subtend.
• Yes it does; often this is omitted, but strictly speaking the expression should be something like $\sigma \int \epsilon T^4 d\Omega$ integrated over the full $4\pi$ solid angle, taking account of the relative size, temperature and emissivity of every point you "see" – Floris Oct 5 '17 at 20:22