Since in the static case,
$$
\mathbf H = \mathbf B/\mu_0 - \mathbf M
$$
leads to
$$
\nabla\times\mathbf H = 0,
$$
it follows that the field H can be imagined as a potential field. Since
$$
\nabla\cdot \mathbf H = -\nabla \times \mathbf M,
$$
which is nonzero only at the faces on the ends of the bar magnet, the field H can be regarded as generated by a pair of magnetic poles located at those ends; the lines of the field originate in the N pole and get absorbed in the S pole, similarly to the electric field of an electric dipole. Inside the magnet, the field H points from N to S.
However, for the B field,
$$
\nabla\times\mathbf B \neq 0,
$$
so it is not a potential field and cannot be imagined as due to poles. Outside the magnet, the B and H field are always proportional. However, since
$$
\nabla *\cdot \mathbf B = 0,
$$
the B field has no sources and thus tranverse the faces of the magnet withotu change. Hence due to continuity, the B field inside the magnet points from S to N.
So inside the magnet, the two fields point in the opposite directions.