Answer:
Magnetic forces.
When the magnets are put together, the north pole is attracted to the south pole, which the south pole goes toward the opposing pole on the opposite magnet. Complicated, yes, but how magnets work.
I hope this helps!
4.5m questions
5.9m answers