Let's suppose that there is a magnet with a north and south pole and we break this magnet randomly. Which factors determine which pole is going to be N and S in the broken pieces of the magnet.
The part which contains the old north pole will have to get a new south pole, and vice versa, like this picture:
If the old north pole piece gets another new north pole, you end up with a magnetic monopoles; those haven't been experimentally observed yet. Due to the divergenceless property of magnetic fields, we don't observe these monopoles, though they have been hypothesized to be exist at sufficiently high energies.