we know that like poles repel each other and unlike poles attract each other. hence when south pole of one magnet is placed near the north pole of other magnet, the two magnets attract each other due to interaction of magnetic fields of the two magnets. the magnetic field lines originating from north pole of one magnet ends at the south of other magnet