Flamenco is the music of the nomadic Roma people who, during their migrations, crossed the entire Middle East and Mediterranean; it is the art form of the wandering people who, after a long pilgrimage through the centuries, found a home in Spain, where they settled and mingled with other groups of Arab culture.
Specifically, Andalusia, a region with a centuries-old cultural and scientific tradition marked by multi-ethnicity, is where the Gypsy tradition found the most suitable conditions for its integration.
The term flamenco (which in Spanish means flamingo) derives from the union of the Arabic words "felag" (peasant) and "mengu" (wandering - fugitive) and in the 18th century acquired its linguistic connotation as a synonym for Gypsy. Proof of this can be found by examining "Cartas Marruecas de Cadalso" from 1774, one of the first historical documents on this topic, where this music is explicitly attributed to the Gypsies.
This is why defining flamenco as merely a dance or a musical genre is perhaps restrictive. It is both, but the meaning is even higher: it is a form of theatrical representation of life, it is the Gypsy way of telling their experiences.
Flamenco is the history and culture of the Gypsy world.
