Let me give a sketch of the flow of logic in classical mechanics.
Assume Newton's laws are true. One can, by using the D'Alembertian principle, and on holonomic systems, find that we can rewrite Newton's second laws as 'Lagrange's equations' $\frac{d}{dt} \frac{\partial L}{\partial \dot{q}_j} - \frac{\partial L}{\partial q_j} = 0$, where we have defined $L = T - V$, called the Lagrangian. (This construction of $L$ is of course not unique).
Now let's abandon Newton's 2nd law as your starting point. Let's say that instead we write the Lagrangian $L = T - V$ of the system. Also let's take the so-called Hamilton's principle as an axiom: the motion of the system from time $t_1$ to $t_2$ is such that the line integral (called the action) $S = \int_{t_1}^{t_2} L dt$ has a stationary value for the actual path of the motion. It turns out that the stationary value for $S$ is given by paths which satisfy the Euler-Lagrange equations, $\frac{d}{dt} \frac{\partial L}{\partial \dot{q}_j} - \frac{\partial L}{\partial q_j} = 0$. Hence we have recovered Newton's 2nd law.
So what do we have here? We see that Newton's 2nd law $\iff$ Lagrangian with Hamilton's principle. In other words, Newton's 2nd law and the Lagrangian description of mehchanics are equivalent (at least for holonomic systems, though that can be generalized).
Now which starting point do we take to be more sacred? Newtonian or Lagrangian? When we first learned classical mechanics the Newtonian approach was the holy path, but for various reasons (aesthetics, generalization to field theories / QM, explicit symmetry dependence etc.) we prefer the Lagrangian approach.
That is to say, we postulate that every system has a (or a family of equivalent) Lagrangian(s) that describe(s) it, and taking Hamilton's principle as our axiom, apply the Euler-Lagrange equations to $L$, thereby obtaining the equations of motions.
Now the question is, what $L$ works? Earlier I wrote $L = T - V$, but actually, this is a matter of guesswork, because ultimately, physics is an empirical science so whatever theories we come up with had better corroborate with real-world measurements. It turns out that $L = T - V$ is a good guiding principle, but there are some cases in which it is not so clear. For example, in writing a Lagrangian for the electromagnetic field or for GR, we are 'guided' by the known EOMs to write $L$ down. Then, once we find an $L$ that works, we take it to be the holy grail from which everything is derived from (including the EOMs), discarding the fact that we used the EOMs to 'derive' the Lagrangian.