This song from Celia Cruz, "Bemba Colora," is a great example of how Afro-Cuban clave works

https://www.youtube.com/watch?v=ldNpOpr3afU&ab_channel=alfredU

So the rhythmic base of afro-cuban music is the clave. If you look at these two figures, you'll notice that they're the same, just depending on whether you choose to start on the one with the three beats in a measure or with two.



Regardless of whether you choose to start on the 2 or the 3 side, once the clave rhythm gets started, it does not change throughout the song. That is to say, this is "illegal": 


The entire rhythmic section is set up to "support" the clave you pick, so you cannot arrange a song in 3-2 clave with piano, horns, etc. in 2-3 style

So there's a difference in how a song sounds depending on which clave you pick on. Think of it as a rhythmic key

Here's the thing - it is possible to change (rhythmic) key!

You can't do it the illegal way where you just decide that at the end of one clave section, you just start the new one, so how does it work? 

What you do, melodically, is add a measure, and then make the NEXT one the more important one. The clave itself remains unaltered, but you have changed which side you choose to emphasize.

This song begins in 3-2 pattern, until 2:18, when you hear an extra horn bit, which "slides" the song over into being in 2-3!

If you keep performing the clave bit yourself, you will notice that it never actually changes during the song. It is everything else that changed around the clave. Basically, you use hypermeter to change clave.