Suppose that we have a sample $X_1,\ldots,X_n$ from the distribution with density function $$f(x\mid\theta) = \dfrac{2x}{\theta^2}\mathbb{1}_{(0,\theta)}(x)$$ w.r.t. the Lebesgue measure. I recently learned that if we use $T(X) =\max(X_1,\ldots,X_n)$ as an estimator for $\theta$, the density function of $T(X)$ equals $$f_n(x\mid\theta) = n(F(x\mid\theta))^{n-1}f(x\mid\theta) = \dfrac{2n}{\theta^{2n}}x^{n-1}\mathbb{1}_{(0,\theta)}(x)$$ and thus that $$\operatorname{E}_\theta(T(X)) = \displaystyle\int_0^\theta x\dfrac{2n}{\theta^{2n}}x^{n-1}\mathbb{1}_{(0,\theta)}(x) \, dx.$$ What I don't understand is when the density function of an estimator differs from the density function of the data. In my book the following example is given:
Suppose $X\sim\operatorname{Geom}(\theta)$, with $\theta\in(0,1)$. We seek for an unbiased estimator for $\theta$. We have that $$\operatorname{E}_\theta d(X) = \sum\limits_{i = 1}^\infty d(i)\theta(1-\theta)^{i-1}$$ where $d(X)$ is an estimator for $\theta$. Here the density function of the data is used to calculate the expected value of the estimator. Why is this case different to the case with the order statistic? This computation of the expected value would surely be wrong if $d(X)$ equals the order statistic right?
Question: When calculating the expected value of an estimator, how do you determine which density function you should use? Is the order statistic a special case? I would really like to know what the underlying theory behind all this is, because now it comes across as quite random.
Thanks in advance!