Variety adds interest by using contrasting elements within the composition.
The example below is a very simple illustration of the principle, using circles of different sizes and colors to show how a composition can be unified by similarities, and how interest can be added by varying aspects of the composition.
Unity in an artwork creates a sense of harmony and wholeness, by using similar elements within the composition and placing them in a way that brings them all together.