Lagrange equation 1788, and Hamilton principle 1834 Lagrange's equation and Lagrangian and derived in 1788. It is different from Newtonian mechanics view because Newton emphasizes the external force acts on the body. But the Lagrange's. view is that the internal energy (kinetic or potential, etc) associated with the body.
Hamilton principle is stated in 1834. It is a variational and minimal (minimization) principle.
Since Lagrange equation 1788, and Hamilton principle 1834 are nearly 50 years apart,

how and what does Lagrange rely on (as which logical thought behind) to derive his Lagrange's equation and Lagrangian, without relying on Hamilton variational principle? How is it possible?

 A: Lagrangian and Euler-Lagrange equations come from the Newton's second law plus the requirement that the force is a function of position. In order to be valid for generalized coordinates $q_i$ and $\dot q_i$ the D'Alembert principle is also necessary.
$\delta(\int {L}dt) = 0$ results from that equations, and not the other way around.
A: The most important innovation introduced by Lagrange was the systematic use of generalized coordinates.
In retrospect: Lagrange used the work-energy theorem, except not in the modern form. The form that Lagrange used was, as already stated in another answer, d'Alembert's virtual work.
Looking back: from my perspective d'Alembert's virtual work looks like an obfuscated version of the work-energy theorem.
Be it as it may: Lagrange was able to create a formulation of classical mechanics (Lagrangian mechanics) that is very expressive and versatile. So I'm guessing that for Lagrange there was no particular incentive to clarify the concept of d'Alembert's virtual work.

Force is frame-independent. On the other hand: the kinetic energy that is attributed to an object is frame dependent. Evaluation in terms of kinetic energy and potential energy is inherently in terms of change of energy; it is change of energy that is frame-independent.
There is no such thing as an inherent zero point of potential energy; what can be defined is difference of potential energy. Physicists capitalize on that by placing the zero point of potential energy at whatever level happens to be practical to perform calculations.
Lagrangian mechanics does not work with kinetic/potential energy itself. To evaluate physics taking place lagrangian mechanics works with the derivative of kinetic/potential energy.


William Rowan Hamilton had made significant contributions in the field of geometric optics. Geometric optics is treating all of optics in terms of statements in the same form as Fermat's least time.
Hamilton next set out to find out whether it is possible to restate classical mechanics in a variational form, analogous to Fermat's least time.
Hamilton's stationary action is mathematically equivalent to the work-energy theorem.

Other than the concept of Hamilton's stationary action: Hamilton also laid the basis of the concept of describing physics taking place in terms of motion in phase space. There are classes of problems that were solved because of insights gained from examining motion in phase space.
Just for completeness:
Hamiltonian mechanics and Hamilton's stationary action do not have overlap; they are independent concepts.
