Let's do a little experiment first. Find two refrigerator magnets can try it. Attach the magnetic sides of the two refrigerators together. Slowly push in parallel to separate the two, you will feel the attraction and repulsion for a while. This will not happen in the case of non-parallelism. This is also the reason for the Halbach array of refrigerator magnets.
The whole Halbach array can be regarded as two basic units composed of the arrangement of "↓↑↓" and the structure of "→←". The magnetic fields generated by these two structures are in the same direction at the top and reverse at the bottom. Therefore, after the two are superimposed, they are enhanced at the top and cancel each other out at the bottom.
This is because the magnets on fridge is a special magnet structure called "Halbach Array". By arranging the magnets, the array on one side of the magnetic field can be arranged stronger, and the array on the other side can be nearly zero. In this way, although the rubber magnet (composite of bonded ferrite magnetic powder and synthetic rubber) used in the refrigerator magnet is very weak, it is about two to three percent of the neodymium iron boron, but it can still be on its back. That is, the magnetism on the side of the refrigerator is greatly enhanced.