This is an interesting question. You are right in how you think about potential energy. There are more bodies involved than just the one we are trying to get the trajectorie from. Saying a particle moves in a static external potential is always an approximation. I want to motivate this:
In classical mechanics you often deal with closed systems: You have a single particle which moves in a system subjected to a static external field, described by some potential, e.g. $\phi \propto x^2$. Imagine it like this: There is this potential and then you bring in the particle. In all of these exercises it's assumed that the potential is unchanged by introducing this particle and independent of the movement of the particle. In this sense it is static.
But in reality the particle itself can alter this potential. The $\propto x^2$ potential is caused by one or multiple external particles and their interactions between each other. Brining in the single particle introduces new interactions and changes the potential. The potential in which the single particle moves now is actually a function of the external generalized coordinates $\vec{\lambda}$ and the coordinates of the single particle itself $\vec{r}$
$$\phi=\phi(\vec{r},\vec{\lambda})$$
In order to exactly solve for the trajectorie of the single particle you have to solve a very complex Hamiltonian containing all of the external interactions. That means you also have to solve for the movement of the particles causing the potential.
This is something you often can't do, the Hamiltonians are just too complex. What you do is approximate the potential as
$$\phi\approx\phi(\vec{r})$$
And assume it's only dependent on some external parameters, that aren't influenced by the single particle. So you assume that brining in the single particle changes nothing. This is a very powerful method and allows us to gain a rough understanding of real life interactions.
But it can have it's downfalls. Let's consider a classical example from CED: You have a large configuration of charges which make up a electromagnetic field. This field is described by some potential, e.g. $\propto \frac{1}{r}$. Now you want to consider how a small charge moves in this field. Well then most of the time you assume that the small charge doesn't alter the large configuration and moves in the static $\propto \frac{1}{r}$ potential. But now imagine a very fragile but initally stable large configuration which causes this potential. The small test charge would cause a colapse of the configuration. Here the assumption that there is movement in a static external field leads to wrong results.