How does piezo element works?

I mean what's connection between delay in microseconds between on/off power and the way those waves act?
I mean for example there's wave : _________________________
I make output on piezo element HIGH .. and this wave becomes like:
------------------------------------ ?
and then i put in low, and there's: ---
_______________________

So when you use arduino example (melody), you get something like this:
-------------------------------- and so on?
links would be appreciated.

What if I use analog output?

Have a look at Square wave - Wikipedia

Especially play the sound. The frequency changes the pitch that you hear, so longer times between high and low sound like a lower note.

analogWrite doesn't actually output an analogue value. It is a pulse-width modulated (PWM) signal. The voltage is either high or low, but the ratio of high to low gives an 'average' value which "appears" to be analogue to some systems, e.g. our eyes when flashing an LED on and off rapidly.