The alpha over node stacks images on top of each other, it places one image on top of the other using the alpha channel:
If you want to animate which one is on top you can double the alpha over setup (swapping the image order) then use a a mix node to swap the image order.