When a permanent magnet is produced it is initially unmagnetised and it has to be magnetised to saturation to give it its maximum magnetic performance. This requires placing the magnet inside an electromagnet that applies a field to the magnet to drive magnetism into it until the magnet is fully saturated to Bs (so it cannot align any more of its magnetic domains because they are already fully aligned with the applied magnetic field).
So an external magnetic field can magnetise an unmagnetised magnet. If you reverse the external magnetic field so it now opposes the magnet’s Direction of Magnetisation, the magnet will be experiencing an applied field which could, if strong enough, start to demagnetise (weaken) the permanent magnet.
So how large an external magnetic field do you require to start to partially demagnetise a magnet and to even fully demagnetise a magnet? The answer depends on many variables, in particular the magnet shape, the total magnetic circuit, the temperature of the magnet and the BH curve of the magnet material being demagnetised. Every magnet in in a magnetic circuit (the magnetic field from the magnet interacting with the all the materials (air, mild steel, other magnets, electromagnets, etc) surrounding the magnet and this gives a Pci (Intrinsic Permeance Coefficient) which gives a working point on the Intrinsic Curve for the magnet material.
If the Intrinsic Permeance Coefficient for the NdFeB magnet is known then an Intrinsic Load Line can be drawn from the origin (B=0, H=0) and where it crosses the Intrinsic BH curve the intersection on the Intrinsic curve is called the Intrinsic working point. If the magnitude of the externally applied demagnetising field is known (of magnitude Ha), the Intrinsic Load Line can be translated along so the start of the Intrinsic Load Line has moved from H=0 to H=Ha. The slope of the Intrinsic Load Line is the same but the Intrinsic working point on the Intrinsic curve has moved (the working point will have moved along the Intrinsic BH curve as the Ha increased in value). The working point on the Intrinsic curve will move as the applied field Ha changed in magntitude. When the externally applied field Ha is removed, the Intrinsic working point ‘recoils’ back but at a slope equal to the Intrinsic curve slope where H=0 and B=Br. If the Intrinsic working point due to the applied field Ha has not entered the region of the ‘knee’ of the Intrinsic curve, the demagnetisation of the magnet is minimal (the recoil slope may follow the original BH curve back towards Br), possibly so little it cannot be measured (the recoil follows the original Intrinsic BH curve)
If the Intrinsic working point has gone into the region of the ‘knee’ as Ha has been applied, when Ha is removed the recoil does not follow the original BH curve shape but recoils back at a lower value – a new BH curve shape has been produced which has a lower new Br (this is the effect of the demagnetisation – a weakened magnet due to a lower Br). Applying an external field again up to the same magnitude of the original Ha has no further demagnetising effect. The magnet is said to be ‘conditioned’ for that level of applied field.
If an even stronger Ha demagnetising field is applied then further demagnetisation will occur.
If the Ha equals Hc (the Coercive force), the magnet will appear to have no magnetic output whilst the Ha field is being applied. Removing the Ha field will have caused potentially severe demagnetisation (leaving behind a severely weakened magnet).
If the Ha equals Hci (the Intrinsic Coercive force), the magnet will appear to have a reverse magnetic field output whilst the Ha field is being applied. Removing the Ha field will have caused total demagnetisation (the magnet will appear “dead” - it will show no net magnetic performance).
It should be noted that for SmCo, most Alnico and NdFeB as the magnets heat up, Br and Hci fall which make the magnets more prone to being demagnetised because the “knee” is being brought closer to the Intrinsic working point. Ferrite is an exception because the Hci increases as the magnet heats up (so cold is a problem for ferrite).
There are some applications where the magnet needs to be weakened to give a reduced required performance (e.g. alnico assemblies for mass spectrometers). The method of deliberately weakening the magnet for use is sometimes called ‘conditioning’ / ‘stabilising’ and the process of weakening is known as ‘knocking back’ and externally applied magnetic fields can give this effect.
Externally applied demagnetising fields can also be applied to mimic the effect of a demagnetising high temperature exposure. So instead of exposing the magnet to a high temperature (for ‘thermal stabilising’) if you know by how much the magnet weakens from exposure to that high temperature then you can work out what level of Ha needs to be applied to do the same task using an electromagnet.
Magnets must be held securely in place when inside electromagnets otherwise they can move or rotate around. For example if you were to place a fully magnetised magnet loose inside an electromagnet and try to apply 3-5 Tesla to demagnetise it, the magnet would either spin about rapidly and possibly break due to the domains ripping the magnet apart because it was not restrained or the magnet would fire out of the electromagnet literally like a bullet being fired. When any magnet interacts with an applied magnetic field the magnet will want to align with the strongest part of the applied field and will reposition itself into best attractive alignment or get itself out to a position of least repulsion.
And, for completeness, if you place a magnetised magnet inside a solenoid with an external magnetic field in the same direction as the field from the magnet, it will not weaken the magnet. Should the magnet have been weakened by heat or by another external magnetic field then some of the magnetic domains would start to realign due to the magnetising field being applied and the magnet would start to gain some of its original performance until the magnet saturates at Bs if the applied field is strong enough (it would be remagnetising the NdFeB magnet).