As most things European, it probably comes from the Middle East.
It's basically ground almonds and sugar, but a chemically quite interesting mix of oil and sguar matrices.
Sicilian tradition is to shape them into fruits and paint them and Königsberg they torch them.
French recipe
150 gr almonds (with maybe one or two bitter almonds thrown in)
syrup (cook to 120°)
300 gr sugar
100 gr water
30 gr glucose
30 gr liquidaroma (1:1 syrup, Kirsch, rosewater…)
Coarsely blend almonds, then add syrup while stirring until it has crystallised around the flour. Let cool by spreading on a silicone mat. Add liquid and blend very finely (in a powerful blender, last attempt broke my Nutribullet). I used 15 gr Kirsch and 15 gr 1:1, and the Kirsch flavour was quite pronounced already!
Knead on silikon mat (or baking sheet), then shape (cubes for example, which you can dump in chocolate.