Actually, there are 2 types of magnetic interactions which seem to be very different on the phenomenlogical level (but have the same origin on the microscopical level):
1) magnetic interaction between moving charges
A electric current --- thus moving charges -- (or a (fast) changing electric field) is needed for the generation of the magnetic field according to Ampere's circuital law. Second the created magnetic field only acts on moving charges (not on charges at rest) according to Lorentz' law ($\mathbf{v}$ is the velocity of the moving charge):
$$\mathbf{F} = e(\mathbf{v}\times \mathbf{B})$$
In this respect magnetic interaction is different from electrical interaction where a charge (an electric monopole) at rest can already generate an electrical field (whereas magnetic monopoles do not exist respectively have not been seen yet) and can act on charges at rest.
This is the origin of the magnetic forces between 2 wires.
2) mutual interaction of magnetic dipoles
(A permanent magnet is a magnetic dipole)
Sources distributed in space of the magnetic or electric field can be developed in a series of
monopoles, dipoles, quadrupoles etc. It is actually a Taylor series which
helps to classify sources of the magnetic field of different distribution.
Particularity of the magnetic case is that monopoles do not exist. In different words, the first term in the mentioned series is zero. The force between magnetic dipoles is based on
$$\mathbf{F} = \nabla(\mathbf{m}\cdot \mathbf{B}) \tag{1} $$
where $\mathbf{m}$ is the magnetic moment and $\mathbf{B}$ is the magnetic induction (also called magnetic flux density). Actually the $\mathbf{B}$ can be or any origin, but if it comes from another magnetic dipole it can be computed by:
$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\left[ \frac{3\mathbf{r}(\mathbf{m}\cdot \mathbf{r})}{r^5} - \frac{\mathbf{m}}{r^3}\right] \tag{2}$$
where $\mu_0$ is the vacuum permeability and $\mathbf{r}$ is the vector between the center of the dipole and the point where magnetic induction is required. (2) inserted in (1) yields a quite complicated expression that can be simplified under certain circumstances. For instance if the poles of the dipole is small enough, then each pole can be considered as a magnetic point charge which makes the full expression for the magnetic force $\mathbf{F}$ much simpler.
The same interaction also exists for electrical dipoles although it is less frequent in daily life, but quite common between molecules for instance.
This is the origin of the magnetic force between 2 magnetic dipoles respectively permanent magnets.
Actually, there would be a lot of stuff to be said additionally to this post, above all the microscopic origin of the magnetization of material, in particular a permanent magnet, how to take correctly account for the effects of magnetization of material etc.
But this would be out of scope of the given question. Anyway, wikipedia is an excellent source to get an overview on these topics.