How do magnetism and electricity work together?
1 Answer
Electricity and magnetism are two sides of the same coin, known as "Electromagnetism".
1) An electric current in a wire generates a magnetic field around it;
2) When a wire is moved through a magnetic field, an electric current is induced in it;
3) Electric charges attract or repel each other; magnetic poles do similar (and always exist as north-south pairs).
Explanation:
Electricity and magnetism are two sides of the same coin, known as "Electromagnetism", something which is made clear by Maxwell's Equations, which explicitly link them - but these may be a bit advanced for where the student asking the question is at?
Maxwell's 19th century experiments on the subject demonstrated several interlinked properties of electricity and magnetism:
1) An electric current in a wire generates a magnetic field around it;
2) When a wire is moved through a magnetic field, an electric current is induced in it;
3) Electric charges attract or repel each other; magnetic poles do similar (and always exist as north-south pairs).
If you are interested in seeing mathematically how the two interact, have a read about Maxwell's Equations. They're a bit daunting to look at if you haven't studied Vector Analysis, but the concepts they describe are intuitive and easily understood whatever one's level of physics/maths education. This website - http://www.maxwells-equations.com/ - explains what's going on in them while trying to keep things intuitive.
There's your answer, but it also worth noting that the "unification" of electricity and magnetism to make electromagnetism provides the model for some later more advanced unifications of forces - a research effort that is as yet not completed. There are physicists working today to unify gravity into the other fundamental forces: http://hyperphysics.phy-astr.gsu.edu/hbase/Forces/funfor.html
https://en.wikipedia.org/wiki/Grand_Unified_Theory