Oersted discovered that electric currents create magnetic fields by observing that a compass needle deflected when placed near a wire with a current. He established that a moving electric charge produces a circular magnetic field around the conductor. The right-hand rule determines the direction of this magnetic field based on the direction of current flow. Oersted's findings led to new technologies like motors and generators by demonstrating the control of magnetic fields using electricity.