Why does maximum likelihood estimation for uniform distribution give maximum of data? I am looking at parameters estimation for the uniform distribution in the context of MLEs.  Now, I know the likelihood function of the Uniform distribution $U(0,\theta)$ which is $1/\theta^n$ cannot be differentiated at $\theta$. The conclusion is that the estimate of $\theta$ is $\max(x_i)$, where $x_1,x_2,\ldots,x_n$ is the random sample. I would like a layman's explanation for this.

Your likelihood function is correct, but strictly speaking only for values of $\theta \ge x_\max$.
As you know the likelihood function is the product of the conditional probabilities $P(X_i=x_i|\theta)$.
$$L = P(X_1=x_1|\theta) \times P(X_2=x_2|\theta) \times \ldots \times P(X_2=x_2|\theta) $$
We can look at three different cases for your $\hat\theta$ = the estimate of $\theta$ that maximizes the likelihood.
(i) $\hat\theta_1 < \max(x_i)$
Let's say that $x_j=x_\max$. This gives $P(X_j=x_\max|\theta=\hat\theta_1) = 0$, because $x_\max$ is outside the support of the random variable, and so
$$L = P(X_1=x_1|\theta=\hat\theta_1) \times \ldots \times P(X_j=x_\max|\theta=\hat\theta_1) \times \ldots \times P(X_2=x_2|\theta=\hat\theta_1) = 0 $$
(ii) $\hat\theta_2 > \max(x_i)$
Here all the data is within the support so we have $L=1/\hat\theta_2^n$.
Clearly case (ii) is better than (i) because $1/\hat\theta_2^n > 0$.
(iii) $\hat\theta_3 = \max(x_i)$
Once again $L=1/\hat\theta^n$. But case (iii) is better than case (ii) because $\forall a,b:\; a>b>0 \;=>\; 1/a < 1/b$.
So out of the three cases, case (iii) maxmizes $L$. (Note that you can use calculus to show that $L$ is monotonically decreasing for $\theta < x_\max$ if you wish.)
