We know that current carrying wire produced a magnetic field of its own. There happen action and reaction between magnetic field existing inside the opposite pole of a powerful magnet and the magnetic field of current carrying wire. Your teacher can show you the action and reaction. You can do it yourself or with the help of your teacher. Put an electric wire between the two poles of a powerful magnet like the picture. Let the electricity flow through this wire. You will see that it will jump them up. It is understood that a force is working on that. From where does this come?
If you look at picture (a), you will see the lines of force between the poles of the magnet. The magnetic field created by electric current has also been shown. The lines of force created from the combination of two fields have also been shown in picture (b). The lines of force are more on the down than that of the up of the wire. The reason is that both the fields are working towards the same direction. [Again see the picture (a)].The fields above the wire are opposing each-other, some lines of force are rejecting one-another. As a result, the number of lines is less there. As the line wants to keep themselves very tight to each other (like elastic rubber), they apply the upward force on the wire.
If the wire remains free, it moves upward. If the direction of electric current is changed to the opposite, the wire goes to downward.