Perturbative expansion. OP's $\phi^4$ theory example is a special case. Let us consider a general action of the form
$$ S[\phi] ~:=~\underbrace{S_2[\phi]}_{\text{quadratic part}} + \underbrace{S_{\neq 2}[\phi]}_{\text{the rest}}, \tag{1} $$
with non-degenerate quadratic part$^1$
$$ S_2[\phi] ~:=~\frac{1}{2} \phi^k (S_2)_{k\ell} \phi^{\ell} . \tag{2} $$
The rest$^2$ $S_{\neq 2}=S_0+S_1+S_{\geq 3}$ contains constant terms $S_0$, tadpole terms $S_1[\phi]=S_{1,k}\phi^k$, and interaction terms $S_{\geq 3}[\phi]$.
The partition function $Z[J]$ can be formally written as
$$\begin{align} Z[J] ~:=~~~& \int {\cal D}\frac{\phi}{\sqrt{\hbar}}~\exp\left\{ \frac{i}{\hbar}\left(S[\phi] +J_k \phi^k \right)\right\} \cr
~\stackrel{(1)}{=}~~~& \exp\left\{\frac{i}{\hbar} S_{\neq 2}\left[ \frac{\hbar}{i} \frac{\delta}{\delta J}\right] \right\}\cr
&\int {\cal D}\frac{\phi}{\sqrt{\hbar}}~\exp\left\{ \frac{i}{\hbar}\left(S_2[\phi] +J_k \phi^k \right)\right\} \cr
\stackrel{\text{Gauss. int.}}{\sim}&~
{\rm Det}\left(\frac{1}{i} (S_2)_{mn}\right)^{-1/2}\cr
&\exp\left\{\frac{i}{\hbar} S_{\neq 2}\left[ \frac{\hbar}{i} \frac{\delta}{\delta J}\right] \right\} \cr
&\exp\left\{- \frac{i}{2\hbar} J_k (S_2^{-1})^{k\ell} J_{\ell} \right\}, \end{align}\tag{3} $$
after a Gaussian integration. Here$^1$
$$ G^{k\ell}~=~-(S_2^{-1})^{k\ell} \tag{4}$$
is the free propagator. The RHS of eq. (3) represents the sum of all$^3$ Feynman diagrams built from vertices, free propagators and external sources $J_k$.
Euler-Lagrange (EL) equations$^4$
$$ - J_k ~\approx~\frac{\delta S[\phi]}{\delta \phi^k}~\stackrel{(1)+(2)}{=}~ (S_2)_{k\ell}\phi^{\ell} +\frac{\delta S_{\neq 2}[\phi]}{\delta \phi^k} \tag{5}$$
can be turned into a fixed-point equation$^5$
$$\phi^{\ell}~\approx~-(S_2^{-1})^{\ell k}\left( J_k + \frac{\delta S_{\neq 2}[\phi]}{\delta \phi^k} \right),\tag{6}$$
whose repeated iterations generate (directed rooted) trees (with a $\phi^{\ell}$ as root, and $J$s & tadpoles as leaves), as opposed to loop diagrams, cf. OP's calculation. This answers OP's questions.
Finally, let us mention below some hopefully helpful facts beyond tree-level.
I) The linked cluster theorem. The generating functional for connected diagrams is
$$ W_c[J]~=~\frac{\hbar}{i}\ln Z[J]. \tag{7}$$
For a proof see e.g. this Phys.SE post. So it is enough to study connected diagrams.
II) The $\hbar$/loop-expansion. Assume that the $S[\phi]$ action (1) does not$^6$ depend explicitly on $\hbar$. Then the order of $\hbar$ in a connected diagram with $E$ external legs$^7$ is the number $L$ of independent loops, i.e. the number of independent $4$-wavevector$^8$ integrations.
Proof. We follow here Ref. 1. Let $I$ be the number of internal propagators and $V$ the number of vertices.
On one hand, for each vertex there is a 4-wavevector Dirac delta function. Except for 1 vertex, because the external legs already satisfy total wavevector conservation. (Recall that spacetime translation invariance implies that each connected Feynman diagram in wavevector space is proportional to a Dirac delta function imposing total 4-wavevector conservation.) The $V$ vertices therefore yield only $V-1$ constraints among the $I$ wavevector integrations. In other words, the number of independent loops is$^9$
$$L~=~I-(V-1). \tag{8}$$
On the other hand, it follows$^{10}$ from the RHS of eq. (3) that we have one $\hbar$ for each internal propagator, none for each external leg, and one $\hbar^{-1}$ for each vertex. There is also a single extra factor of $\hbar$ from the rhs. of eq. (7). Altogether, the power of $\hbar$s of the connected diagram is
$$ \hbar^{I-V+1}~\stackrel{(8)}{=}~\hbar^{L},\tag{9}$$
i.e. equal to the number $L$ of loops. $\Box$
III) In particular, the generating functional of connected diagrams
$$W_c[J]~=~W_c^{\rm tree}[J]+W_c^{\rm loops}[J]~\in~ \mathbb{C}[[\hbar]]\tag{10} $$ is a power series in $\hbar$, i.e. it contains no negative powers of $\hbar$. In contrast, the partition function $$Z[J]~=~\underbrace{\exp(\frac{i}{\hbar}W_c^{\rm tree}[J])}_{\in \mathbb{C}[[\hbar^{-1}]]}~\underbrace{\exp(\frac{i}{\hbar}W_c^{\rm loops}[J])}_{\in \mathbb{C}[[\hbar]]}\tag{11}$$
is a Laurent series in $\hbar$.
References:
- C. Itzykson & J.B. Zuber, QFT, 1985, Section 6-2-1, p.287-288.
--
$^1$ We use DeWitt condensed notation to not clutter the notation. If we spell out eq. (2) in its full glory it reads
$$S_2[\phi]~=~\frac{1}{2}\int\!d^dx\int\!d^dy~\phi^{\alpha}(x)~(S_2)_{\alpha\beta}(x,y)~\phi^{\beta}(y)\tag{12}$$ after possible integration by parts. Here the integration kernel is typically of the form
$$(S_2)_{\alpha\beta}(x,y)~=~\delta_{\alpha\beta}~(\Box-m^2)\delta^d(x-y)\tag{13}$$ with the $(-,+,...,+)$ Minkowski sign convention. If we impose appropriate boundary conditions in eq. (4), the inverse integration kernel
$$(S_2^{-1})^{\alpha\beta}(x,y)~=~\delta^{\alpha\beta}~(\Box-m^2)^{-1}\delta^d(x-y)~=~-G^{\alpha\beta}(x,y)\tag{14}$$
is minus the Greens function
$$(-\Box+m^2)G^{\alpha\beta}(x,y)~=~\delta^{\alpha\beta} ~\delta^d(x-y)\tag{15}$$
with Fourier transform
$$\widetilde{G}^{\alpha\beta}(k)~=~\frac{\delta^{\alpha\beta}}{k^2+m^2-i\epsilon}.\tag{16}$$
$^2$ If we split the action
$$S[\phi] ~=~\underbrace{S_1[\phi]+S_2[\phi]}_{\text{free part}}+\underbrace{S_{\neq 12}[\phi]}_{\text{the rest}}\tag{17}$$
(by including tadpoles in the free part), then the propagator factor on the RHS of eq. (3) becomes
$$\exp\left\{- \frac{i}{2\hbar} (S_{1,k}+J_k) (S_2^{-1})^{k\ell} (S_{1,\ell}+J_{\ell}) \right\}.\tag{18}$$
Conversely, we could formally allow quadratic terms in the $S_{\neq 2}$ part as well, e.g. if we want to treat a mass term as a 2-vertex-interaction. This would of course ruin the logic behind the subscript label of the notation $S_{\neq 2}$, but that's an acceptable prize to pay:)
$^3$ The Gaussian determinant factor ${\rm Det}\left(\frac{1}{i} (S_2)_{mn}\right)^{-1/2}$ (which we normally ignore) is interpreted as Feynman diagrams built from free propagators only with no vertices, although the precise interpretation is quite subtle. E.g. note that if we reclassify the mass-term in the free propagator as a $2$-vertex-interaction, the mass-contribution shifts from the determinant factor to the interaction part in eq. (3).
$^4$ The $\approx$ symbol means equality modulo eqs. of motion.
$^5$ In fact, eq. (6) can be viewed as an operad. A bit oversimplified, while an operator has one input and one output, an operad may have several inputs, but still only one output. Operads may be composed together and thereby form (directed rooted) tree (with the lone output being the root).
$^6$ In order to keep the action $S$ without explicit $\hbar$-dependence, we might have to appropriately redefine mass parameters $m^{\prime}=\frac{mc}{\hbar}$, coupling constants $e^{\prime}=\frac{e}{\hbar}$, etc. If the interaction terms in the action $S$ do depend on $\hbar$, then a diagram will contain the usual loop-power $L$ of $\hbar$s plus a number of powers of $\hbar$ from the corresponding vertices.
$^7$ We assume that the sources $J_k$ are either stripped from the Feynman diagram or are delta functions in wavevector space so that the external legs carry fixed 4-wavevectors.
$^8$ In order not to introduce extra factors of $\hbar$ when we Fourier transform, let us work with 4-wavevector $k$ rather than 4-momentum $p=\hbar k$.
$^9$ If the Feynman diagram is planar, then it is a polygon mesh of a disk, i.e. its Euler characteristic is $\chi=1$. Comparing with eq. (8), we see that the number $L$ of independent loops is then the number of faces.
$^{10}$ The RHS of eq. (3) yields that a propagator attached to $n$ sources contributes with a factor $\hbar^{1-n}$, where $n\in\{0,1,2\}$.