Electricity and magnetism are related phenomena. Electricity is the flow of electrons, which can be static (not flowing) or dynamic (flowing in a circuit). Static electricity builds up when objects rub together, transferring electrons. Magnetism is produced by electric currents and magnetic domains in ferromagnetic materials like iron. Electromagnets are coils of wire that produce strong magnetic fields when electric current passes through. Generators use electromagnetic induction to convert mechanical energy into alternating electric current for power grids.