Meaning: The waves are moving in a rhythmic way that is created by the shape of the land where the water meets the land.
Choice of Words: When waves "dance", it means that they are moving in a rhythmic way. When they "dance" in the "rhythm of the shore", it means that the waves are moving in a rhythmic way that is created by the shape of the land where the water meets the land.