A close examination of the pictures above (shown below) reveals that both are males: characterised by red moustaches -- females have black ones. See https://www.rspb.org.uk/birds-and-wildlife/wildlife-guides/bird-a-z/green-woodpecker
This behaviour then is a sort of harmless "shadow boxing" to establish a territorial hierarchy perhaps.
Click on any picture to expand it.
This sequence has been incorporated into my illustrated talk, "The natural year in focus" detailed at http://www.peterlovetttalks.co.uk/page13.html