One could dive into theory here, but I will choose the approach of using a simple example, and then claiming that things generalise neatly. Mostly they do.
Let's take the simplest non-trivial, linear, homogenous, degree-$n$ differential equation there is:
$$
\frac{d^ny}{dx^n}=0
$$
I am pretty certain you can see the solutions to this equation immediately: All the polynomials of degree strictly less than $n$. For a fixed $n$, how many linearly independent solutions can we pick? It's pretty easy to see that the answer is $n$:
$$
1,x, x^2,\ldots, x^{n-1}
$$
So yes, usually a degree-$n$ differential equation will have an $n$-dimensional solution space.
What happens in the inhomogeneous case? Let's inhomogenize our example equation in the simplest way possible:
$$
\frac{d^ny}{dx^n}=n!
$$
(I could've picked ${}=1$ here, but the solutions would be uglier.) How do we solve this? Well, one solution is clearly $y=x^n$. Now let $y_0$ be an arbitrary solution, and consider $y_1=y_0-x^n$. We know that $\frac{d^ny_0}{dx^n}=n!$, what about $y_1$? We insert and get
$$
\frac{d^ny_1}{dx^n}=\frac{d^n(y_0-x^n)}{dx^n}=n! - n!=0
$$
If $y_0$ is a solution to the inhomogenous equation, then $y_1$ is a solution to the homogenous one. And vice versa. So there is a pairing between the solutions of the inhomogenous equation and the homogenous version. That pairing consists of adding / subtracting one inhomogenous solution (it doesn't really matter which one, but you must fix one and use that).
There is a nice parallel in linear algebra. Consider the (regular, algebraic, underdetermined) set of equations $x+y=1$. It is linear and inhomogenous. How do you solve it? By finding one inhomogenous solution, then solving the homogenous version $x+y=0$. To each of those homogenous solutions you add the one inhomogenous solution you found, and this gives you all the inhomogenous solutions.
And yes, linearity of the involved differential equations is crucial for all of this. It is what ensures that we can add and scale solutions to homogenous equations and still have solutions. Without linearity, this fails. Consider, for instance, the simple but non-linear $y'+y^2=0$. Its solutions (apart from the zero function) are given by $\frac{1}{x-a}$ (there are complications with the asymptote, but let's ignore those). These solutions clearly aren't scalar multiples of one another, and the sum of two solutions clearly isn't a new solution (unless one of them is the zero function). Anything linear about the relationships between solutions disappear when the equation isn't linear any more.