1) Magnets attract iron-containing materials due to their magnetic properties which arise from the alignment of electron spins in their atoms.
2) Øersted discovered that electric currents produce magnetic fields according to the right-hand rule. Biot-Savart's law describes how the magnetic field is produced by a current-carrying conductor.
3) Biot-Savart's law states that the magnetic field produced by a current element is directly proportional to the current and length of the element and inversely proportional to the distance from the element. The direction of the magnetic field is perpendicular to both the current element and the line from the element to the point of interest.