What is AVM2 relates to AS3

I know that AS3 [Actionscript 3] is used for programming a flash/swf.
But what does it do with AVM2 [Actionscript Virtual Machine]?
And What is actionscript virtual machine 1 different than 2? puzzled