We are given the task of placing 7 balls into 3 jars. Step 1: Place 1st ball, 3 ways to do that. Step 2: Place 2nd ball, 3 ways to do that....Step 7: place last(seventh) ball, 3 ways to do that. By rule of product, we have $3*3*3*3*3*3*3 = 3^7$ ways to accomplish the task. Your method is wrong because assumes we need to put a ball in the first jar. We don't need to put anything in the first jar.
Using the Polya Enumeration Theorem we get for the two cases using the
cycle index of the symmetric group with empty boxes
$$Q_1 = [R^3 B^4] Z\left(S_3;
(1+R+R^2+R^3)\times(1+B+B^2+B^3+B^4)\right)$$
and without
$$Q_2 = [R^3 B^4] Z\left(S_3; -1 +
(1+R+R^2+R^3)\times(1+B+B^2+B^3+B^4)\right).$$
Now the cycle index is
$$Z(S_3) = 1/6\,{a_{{1}}}^{3}+1/2\,a_{{2}}a_{{1}}+1/3\,a_{{3}}.$$
Doing the substitution we find
$$\bbox[5px,border:2px solid #00A000]{
Q_1 = 28 \quad\text{and}\quad Q_2 = 18.}$$
If we want to do these by hand, here is an example. We use the
alternate form
$$[R^3 B^4] Z\left(S_3;
\frac{1}{1-R}\frac{1}{1-B}\right).$$
We get from the first term of the cycle index
$$[R^3 B^4] \frac{1}{6}
\frac{1}{(1-R)^3}\frac{1}{(1-B)^3}
= \frac{1}{6} {3+2\choose 2} {4+2\choose 2} = 25.$$
We get from the second term
$$[R^3 B^4] \frac{1}{2}
\frac{1}{1-R^2}\frac{1}{1-B^2}
\frac{1}{1-R}\frac{1}{1-B}
= \frac{1}{2} (1+1)\times (1+1+1) = 3.$$
Here we have e.g. for the coefficient on $B^4$ the possibilities
$(B^2)^2 (B^1)^0,$ $(B^2)^1 (B^1)^2$ and $(B^2)^0 (B^1)^4.$
At last we get from the third term
$$[R^3 B^4] \frac{1}{3}
\frac{1}{1-R^3}\frac{1}{1-B^3} = 0.$$
Add these to obtain $25+3=28.$
Best Answer
If the balls are distinguishable each ball can be placed in any box without restrictions so the number of ways is $4^3$. Why?
If the balls are undistinguishable, use stars and bars.