Opposites attract, likes repell.
That is each magnetic field has a North[N] and South[S] pole, two magnets connect NS or SN. If you try to make a like connection, SS or NN they repel each other, that is if they are laying on a table and you push one magnet towards the other, the other will...