Why iron filings sprinkled near a bar magnet aggregate into separated chunks? When iron filings are sprinkled near a bar magnet, they reveal the "shape" of the magnetic field.
(source)
But why do the (needle-shaped?) filings aggregate into chunks with empty space between them rather than simply rotating in place to align with the direction of the magnetic field?
In other words, why the surface density of the iron filings is not uniform?
 A: I am going to explicitly plagiarise! From Wikipedia https://en.wikipedia.org/wiki/Iron_filings. I'm leaving it pretty much as-is because it's written better than I would put it.
"Iron filings are very small pieces of iron that look like a light powder. Since iron is a ferromagnetic material, a magnetic field induces each particle to become a tiny bar magnet. The south pole of each particle then attracts the north poles of its neighbors, and this process is repeated over a wide area creates chains of filings parallel to the direction of the magnetic field."
If I were to add to this, to think more about the gaps, I would say it might help to step back and think about adding one filing at a time - like the double slit experiment (cos that always makes things really easy to understand, right! ;).
Wherever we put the first piece, it will line up with the field (because it becomes a bar magnet itself).
But if we've put this filing very near one end of the magnet, the magnetic force is strong - if it is strong enough to overcome friction, the filing will slide along and touch the magnet. Further pieces added to that region will do likewise. But, after lots of them have been added, there is no more room for choice. The layer is one-dimensional, so the new additions cannot get to the main magnet; they have to be satisfied with abutting the existing filings. Eventually, the region ends up entirely full - the dense black regions at either end. 
When we add a filing a further away from the ends of the magnet, they still line up with the magnetic field because the magnetic force is strong enough to overcome the local friction involved in spinning. But it is not strong enough though to cause the filing to physically slide over to the magnet. If we add another filing very close to that one, it will feel the first filing's new magnetic force and move to stick to it - N-S-N-S. If we add a third one a little further away, it will be too far to feel the 2 filings and will rotate, but remain where it is. Once you end up with some strings of NSNSNSNSNS's here and NSNSNSN's there, they will reinforce more and more. Further new filings will 'want' to join one of these chains, rather than sit in 'empty' space. So the chains want to grow ever thicker but the spaces want to remain empty.
But at some point, we stop adding filings. And maybe /this/ is the key explanation, then! What if we don't stop but we carry on adding more filings? The next filing will plop into a gap but move and stick to a chain. The one after that will do likewise. And the next, and the next. Gradually, all the space will be used up - and the entire area around the magnet will end up as solidly packed as the area near the ends. It will just be one big, black mass of lined-up filings.
That would not make a very good demonstration of the magnetic field lines, so if my reasoning is right, you only want to have a limited number of filings when making these demonstrations - and similarly, Wooly Willy! ( https://en.wikipedia.org/wiki/Wooly_Willy)
Gordon Panther
A: The surface density of the filings is more in regions where magnetic field is strong. Further the magnetized filings attract each other, thereby increasing the surface density further in regions of higher magnetic field.
This is also not a large deviation from the expected behavior and might just change with experimental conditions
A: Field at the beginning ,is near the magnet is highly localised meaning very high density.As they move away they get spread out what causes the density to decrease.
Now simply consider an example of sun,just outside the surface of sun the temperature is millions of degrees meaning the energy would-be in the order of Peta watt or so per sq.m .But when it reaches the earth it would be around 500-1000 watt per sq.m.
In simple consider another example, mark five spots randomly on a balloon that is not inflated. Now start inflating it,as you blow more and more air the points get apart and is proportional to square of radius.
