It's complicated. Really, really complicated.
And hard, oh so very hard.
So, this kind of texture is not a "natural" consequence of nuts and sugar, in fact it has little enough to do with nuts at all - I'm pretty sure I've seen soan papdi without nuts, and other variations of this technique - and usually the nuts are flaked, and added at the very end (pressed into the top)... they can't have any effect on the texture of the candy before they're even introduced! What the nuts might add is a bit of fats, a bit of starch in slurry, maybe some proteins, in the nut-exclusive recipes like butterfingers. Soan papdi uses flour (and possibly chickpea flour, in some recipes), along with sugar and ghee, in the steps where they're making the bulk of the candy - the nuts are just garnish.
I don't know all the chemistry, if the protein plays a role, but I think it isn't important, I think that the flour and chickpea flour are mostly inert, chemically, in the recipe - just thickening and drying out the sugar (and absorbing the ghee, which separates the strands and keeps the stuff flaky), and all of them adding to the characteristic flavor, of course. I think this is the case because both the texture and technique are somewhat similar to the beginnings of dragon's beard candy (hand pulled sugar floss, essentially, made with just sugar and rice flour... but add ghee and press flat, and it would be very similar stuff).
Anyway, sorry for the tangent, but the technique for soan papdi is to make a sugar syrup, boil it to the single thread or soft-ball stage, and as it cools, it is dumped onto an oiled (ghee'd?) workstation, then stretched and folded - freehand at first but then into cords or strands - generally pulled from the center to make a round, the round doubled over into a smaller loop, then that loop pulled out into a round, doubled over and pulled out, and so it goes until the proper consistency is reached (by this time it will be many rough threads). I think it may be gently heated or the pulling surface or the workspace kept heated, to keep the sugar pliable longer, especially if being made commercially. It's worth noting that this was traditionally made by hand, and it involved a lot, a lot of muscle power and time and effort to make. Anyway, a (pre-cooked) mix of ghee, flour, and chickpea flour would be added to the workstation, and the stretch and fold would continue until the mix was completely absorbed (coating each strand, so they would stay separate, and adding flavor).
Then, to make a flat pan - the round would be cut, threads cut to length, and layered on top of a pan where the slivered nuts, raisins and other toppers had already been sprinkled. The threads were often layered in one direction, but didn't have to be. Then they were pressed down, rolled out, and generally packed into a compact layer. It could then be cut and packaged once it had finished cooling.
So, the flaked nuts don't have anything to do with the texture directly - they aren't added till the end. that texture comes from the constant repeated stretch and fold to make sugar threads, and coating the threads with a starch and fat mixture, so the threads wouldn't re-merge under pressure.
I think butterfingers, and possibly the hulwa, are the result of mechanized versions of the same process. The ground nuts were made into some thin paste or slurry, and added to cooling sugar candy somewhere like halfway through solidifying (too thick to actually mix, thin enough to try?), which finished cooling as the two were mixed. In essence, the fats and starches didn't quite mix with the sugar in the candy, just surrounded it as it was mixed and ended up with sugar in flat-ish flakes and the nut paste formed into layers between the sugar.
Anyway, if you want to make something similar-ish to butterfinger candy or that halva, just to see how it works, what you need is soft-ball stage sugar syrup, cooled enough to be just workable, that is, still runny and sorta stretchy, and add a starch and fats slurry, and sloppily fold the two together - stretching it out, and folding over, as much as you can. Don't mind the mess until the stretch-and-fold gives enough surface area to sort of absorb the slurry. The more it's pulled thin, the dryer it will be (thinly coating all the surface area), and the more it's folded, the more flaky it will be - yes, same basic principle of puff paste, only with solidifying sugar syrup instead of dough, and a hot starch-and-fats paste instead of cold butter.
Or, alternatively, you can start with a soft-ish sugar candy (like, say, candy corn), and heat it up, adding your fats-and-starches slurry while the candy is still cool and solid. As the candy heats and softens and melts, it will pass through the semi-solid stage that's you're looking for, and if you're mixing (folding over) at the time, the candy will flatten out, stick to the slurry (and not to the other candy pieces melting alongside), and generally pass through a flaky layered stage you can use. Of course, if you heat it up all the way I think the sugar will melt, then everything will actually mix instead of layer, and you'll end up with something fudge-like instead of crisp brittle layers - but heating from cold will get you to the same half-melted runny stage you need, if you keep an eye on it and stop mixing before it's actually homogeneous.
You can even make soan papdi in your regular kitchen, or substitute out the flour slurry for nut sauce or whatever variation you want, there are recipes and stuff online... just be prepared for a lot of stretch and folding, and a lot of muscle power to pull thousands of strands of sugar candy into fine, thin, threads.