Pursuant to your comment, I just read an article about good sources of magnesium in food. Amazing: chard, spinach, avocadoes are good sources. All of those are things my daughter has had cravings for since first grade or so. She must need it more than other people do, though, or not metabolize it as well, or something.
Definitely a sign of deficiency but do know that our soils and water are really depleted of mag and even if she ate a lot of those foods she still probably would not get enough. Mag is not water soluable but you do lose a lot when under stress, other things you consume (coffee, sodas, etc) or you sweat a lot. Get her on a good supplement and see what happens.
it’snot hard for kids to have deficiencies. i had a potassium deficiency as a young child.