Why do bar magnets have the least attraction in its center?
Their field lines look like this:
You see that the field lines near the center are parallel to the length of the bar. Moreover, the density of the field lines on the picture is maximized at the "poles" of the bar magnet and minimized at the center which means that the magnitude of the magnetic field is smallest at the center, too.
It's not hard to see why the field lines look approximately as those on the picture above. For an infinitely long magnet, the magnetic field would be fully confined to the cylinder - think of an infinitely long solenoid which essentially has the same magnetic field as a bar magnet. For a bar magnet of a finite length, the field lines ultimately split behind the poles but they're still comparably strong over there.
On the other hand, the field outside the bar, and far from the poles, is only nonzero because of some subleading effects; it would vanish for an infinitely long solenoid - that's why the field is so small over there.
as the middle the magnetic lines are far away from one another and at the poles are close to each other that is why at the center the magnetic force is less than the poles.