Since this is an inhomogeneous linear equation, you know that if $y_{p}$ is a solution, then $y_{p}+Cy_{1}+Dy_{2}$ is also a solution, for arbitrary constant $C,D$.
Let's change a little and look at a vector ODE, $u^{\prime}(x)=v(x)$ where $u$ is a vector-valued function to solve for, $v$ is also a vector-valued function, and both are 2-dimensional. Then 2 things to notice. One, a particular solution for $u$ is easily solved: $u=\int v(x)dx$. Two, if $u_{p}$ is a solution, then $u_{p}+(C,D)$ is also a solution for any constant $C,D$.
This motivate this idea. We want to solve ODE by reducing the problem to just doing antiderivative. The problem of doing antiderivative is equivalent to the problem of solving $u^{\prime}(x)=v(x)$ for some vector equation. And whenever you managed to reduce the problem to the equation of that form, then it is necessarily the case that every solutions can be produced from one particular solution by adding arbitrary constant vector.
So that's the idea. We want to reduce our problem of solving for $y_{p}$ to the problem of solving some $u_{p}$ such that $u$ satisfy an equation of the form $u^{\prime}(x)=v(x)$. Now let's take a look at this:
For any solution $u_{p}$, then $u_{p}+(C,D)$ is also a solution.
For any solution $y_{p}$, then $y_{p}+Cy_{1}+Dy_{2}$ is also a solution.
See the similarly? We want $u$ and $y$ to relate to each other in such a way that adding $C,D$ to each component of $u$ lead to addition of $Cy_{1}+Dy_{2}$ to $y$.
The obvious idea here of course is to relate $y=u_{1}y_{1}+u_{2}y_{2}$. Assume that even one solution can be written in this form, we know that every possible solution could have been obtained by adding arbitrary $C,D$ to $u_{1},u_{2}$. And of course $u=(u_{1},u_{2})$. This is precisely the condition that let it work.
Now, you might wonder why we don't write it as $y=u_{1}y_{1}+u_{2}y_{2}+u_{0}$ where $u_{0}$ is a fixed function to ensure that we are not missing out on any possible functions. We don't expect to need more than one possible choice of $u_{0}$ to capture all solutions though, for the same reason as above. It turns out that we don't need $u_{0}$, or in other word we can pick $u_{0}=0$. Why? Intuitively you can just visualize it: for an arbitrary nice function $y$ then $u$ is a vector such that when taking the dot product of $(y_{1},y_{2})$ with $u$ you get back $y$, so there are actually a lot of freedom in choosing $u$ .