Hamiltonian systems are an abstract formulation of dynamical systems, that have two interdependent degrees of freedom per dimension. In its easiest to describe in an one dimensional case, the two constituting, time dependent variables are position $x$ and momentum $p_x = m v_x = m \frac{d}{dt}\ x $.
Why are these special pairs of two conjugate (lat. married) variables considered as independent, but nevertheless interdependent?
As a preparation of a mechanical experiment, its possible to fix a position of a mass point in space at start time and suddenly boost its velocity, zero in all dimensions, such, that its momentum, product of mass and start velocity, aquires the exactly defined momentum of an other system, a hammer, a tennis racket, a pound of powder in a cannon.
In the moment of preparation of the mechanical experiment, position and momentum are independent at experimentators choice, but during the time evolution, the Newtonian equation of motions produce a trajectory, whose time derivative yields the momentum by Newtons equation of second order, with a conservative field of force $F$.
Force integral along a path yields the work done, called the potentials $-V(x)$.
Newtons equation of motion now say, that the velocity, the time derivative of the positition x, is the 'formal' derivative of what is now called the kinetic energy in terms of the momentum $$T = \frac{p^2}{2m},$$ while the time derivative of momentum is the negative deriviate of the work function V with respect to position
$$\frac{d}{dt} x (t) = \frac{p(t)}{m}\qquad \frac{d}{dt} p(t) = F(x) = - \frac{d}{dx} \left(\frac {p^2}{2m} + V(x) \right)$$
Bottom line: $$ dx = \frac{d}{dp}\ H \ dt \quad dp = - \frac{d}{dx}\ H dt$$
in this single dimension with two degrees of freedom for preparing a trajectory, e.g. the path of projectile.
By a rotation in space (and the rotation in momentum space) its easy to conclude, that this equation is valid for any direction.
By the principle of linear approximations of $x(t), p(t)$ for short time intervalls, Hamiltons equtions for conservative forces are valid for a superpostion of start momentums in different diections in the same place.
Finally, the trajectory at later times can always be considered as a preparation of position and momentum some time later on the trajectory. So Hamilton's equations are governing the whole system for all further times, if the past is given up to time t, but only the current values $x(t1),p(t1)$ enter the calulation of the future $t>t1$.
By the strange fact, that the Newtonian equations for a conservative system of many particles has as total kinetic energy a the sum of the squares of momentums of the single particles, weighted by their inverse masses, Hamilton applies as the central principle of the equations of motion, if the forces can be derived from a potential function of all position variables, too.
Considering the space of momentum and position variables for n-particle system as space with a quadratic norm of momentum variables $T$ and a common potential form $V$, generating the forces by its gradient, one finally comes up with Liouvilles idea, that the Hamiltonian equation describe a 2d- rotation and a dilation in all conjugated momentum-position pairs such that
a fluid of particles somhow distibuted in position-momentum discribes the time evolution o Hamiltonian systems a inincompressible flow in phase space.
This view on Hamilton mechanics of big systems generates a model of thermodynamics as statistical physics.
I quantum theroy, that has no paths and no velocities, the Hamiltonian formulation of classical point mechanics finds a surprising analogon if $p$ is a gradient of a function in $x$.
Here the interdependence of the $$x_k,p_k= -i \partial_{x_k}$$ is again a differential equality, but of so different type, and without any notion of time involved, that this 'first quantization of point mechanics' is a working principle, still presenting a mathematical and physical mystery.