A little dark-haired girl runs on the beach.
The girl with the dark hair is running in the sand.
dark- haired girl refers to girl with dark hair and beach refers to sand
A dark-haired girl is a rephrasing of " girl with dark hair " and "in the sand" means "on the beach".
If she is running on the beach, she would have to be in the sand.