The French scientist, Ampere, (1775- 1836), conducted a series of experiments on the force between current carrying conductors. He found that: force per metre of wire ( I1*I2/r) where I1 and I2 are the currents flowing in the conductors and r their distance apart. The relationship was found to apply to very long, thin, parallel wires.
He concluded that electric currents produce all magnetic fields. It is now known that the magnetic properties of solids can be attributed to orbiting electrons, including a contribution from electron spin, both of which can be regarded as current flow (movement of charge), and that this accounts for the different magnetic properties of materials. The only modification to Ampere's conclusion is that in magnetic materials the atoms align into magnetic 'domains' of macro-dimension.
Ampere also found experimentally that the magnetic field due to a current-carrying conductor falls off with distance from the wire according to 1/r, so the density of (imaginary) flux lines must show this effect, with the number per unit area (i.e. their density) falling as 1/r.