This is a very deep question. I'll give a sort of superficial version of the deep answer.
First, let's ask what a magnetic field is. We say that a magnetic
field is present when electrically charged particles feel a force which
depends on how fast and which way they move.
Now a current in a wire consists of a batch of moving charged
particles- say moving negative electrons- in a background that keeps
the total charge in the wire zero. We say then that it doesn't exert
electrical force on its neighbors. Why then should a neighboring
charged test particle experience a force that depends on how it is
moving? The answer lies deep in Einstein's Special Relativity. From the
point of view of the test particle, the spacing between the charged
particles inside the wire depends on how fast they're moving with
respect to it. So if, according to us, the test particle is moving
along with the ones in the wire, it sees a different density of charged
particles in the wire than it would if it were moving, say, the
opposite way. So the moving particle feels (according to it) a
different electrical force depending on how it moves, with respect to
us. If there were no current in the wire, then the effect would go
away- the test particle would see the same density of positive and
negative particles regardless of its motion.
I know that sounds complicated, but if you draw pictures, you can
see how it works. There's a nice description in a book by Purcell on
Electricity and Magnetism. Of course, the real mystery lies in why
distances look different to observers moving with respect to each
other. All I can do is recommend any beginning text on Special
Relativity.
Mike W.
(published on 10/22/2007)