When a current-carrying wire is put between magnetic poles (two other magnets), the magnetic field around the wire interacts with the magnetic field it has been placed in. This means that the wire now experiences a force. If the force was in the downwards direction for example, the wire would move downwards.