Phrases can be organized in periods. But inside each phrase we can find smaller structures that we call motives. The motive is a rhythmic-melodic pattern that is used to build a phrase. In the following animation you can see some of the motives that appear in Bach's minuet:
We have shown the most obvious motives. But look at the higher voice in measure 7. It could be considered a rhythmic and melodic variation of measure 5. We could also think that the motive in measure 5 is a variation of the first measure motive. The use and development of motives is crucial in reaching a balance between variety and unity when writing a melody.