In Flamenco, Compas (comb-PAS) is everything. Compas means rhythm. The rhythm you listen to, the rhythm a singer sings to, the rhythm a guitarist plays to, the rhythm a dancer dances to and the rhythm a palmero/a (the person who does the hand-clapping) or cajonero/a (person who plays the box drum) claps or bangs out. Compas is THE most important thing in Flamenco. Without compas there is no Flamenco. Regardless of the dancers technique or skill level, if the dancer is not dancing to Flamenco rhythms, and staying within the rhythm structure, it just is not Flamenco.
There are many different rhythms in Flamenco. It is the first job of the Flamenco dancer to become familiar with the different rhythms and, in particular, the rhythm that the dancer would like to dance to. As a student of Flamenco, your job is to learn the rhythms first, not dance steps. Once you understand the rhythm, you can add steps to create dance. Again, to dance Flamenco you must dance to a Flamenco rhythm or it is not Flamenco; it might be Flamenco-style dancing, but it will not be Flamenco.
Unlike other dance styles such as waltz, cha cha, etc, Flamenco is not a dance, it is rhythm. Where you would say, "I am going to learn/dance 'the waltz'," you would never say "I am going to learn/dance 'the Flamenco'." Just a few of the different Flamenco rhythms are Tangos, Alegrias, Bulerias, Soleares, Tientos. You would say "I am learning Alegrias", "I am learning Tangos". You would never say "I am learning the Alegrias" or "I am learning the Tangos". Because.... you are learning rhythm, not steps.
When a dancer begins to learn a new rhythm he/she should find recordings of that particular rhythm and become immersed in that rhythm. And preferably not very orchestrated versions of the rhythm the object is to train your ear to listen to the underlying base rhythm, not to listen to all the embellishments on top.
For example, if you're beginning to learn Tangos, then find recordings with just one guitar playing, then recordings with just a guitar and cajon (box drum) and then just guitar and singer. Skip the recordings with flutes, violins, pianos, etc. Play the recordings over and over until you can tap your toes to them in your sleep. At this point you are starting to tune your body into the rhythm and when you start to put dance steps to it, it will all start to come together.
The Flamenco dancer follows the rhythm when dancing not a song, but a rhythm pattern. The dancer can dance whatever steps or patterns he or she would like to but he/she must do so within the rhythm. The dancer is always accompanied by live guitar (only in some theatrical and non-professional performances will you see a dancer dancing to recorded music).
The guitarist must also follow the rhythm but the dancer does not dance to what the guitarist is playing; the guitarist is playing to what the dancer is dancing. Yes the dancer controls what happens on stage the speed, the pauses, stops, starts all determined by the dancer and conveyed to the guitarist by body movement, not words or choreography. Both artists know the rhythm, but while they are performing together, they are also performing individually. This is one of the finest moments in Flamenco - when the dancer and guitarist are in sync and in perfect communication.