expected payoff of an American put option
An explanation behind this could be that, as you mention


  [...] the payoff of an American put option at maturity is given by
  $$\max\left\{K-S(T),0\right\}$$


and 


  [...] sources [...] say that $$(S,t)=\sup_\tau E[e^{-r(\tau-t)}\max\left\{K-S(\tau),0\right\}]$$


Thus the difference between the two appears to be the discounting factor considering how far (in time) we are from the exercising/stopping date (which is the same as the maturity date if $\tau=T$), which implies to compute (continuously) the present value of this futur payoff. If  $(\tau-t \rightarrow0) \land (\tau=T \lor t \rightarrow T)$, both equations become equal.

If one decides (for some reasons) that the option will be exercised at maturity, i.e. $\tau=T$ and that "now", $t$, is "turning into this futur date $T$", i.e. $t \rightarrow T$, one gets

$T-t \rightarrow 0 \implies \sup_T e^{-r(T-t)} \rightarrow 1$ 

$\implies \sup_T E[e^{-r(T-t)}\max\left\{K-S(T),0\right\}]$

$\rightarrow  E[\max\left\{K-S(T),0\right\}]\rightarrow\max\left\{K-S(T),0\right\}$

Where the last above row shows that the expected payoff becomes certain.