This is without discussion the most famous instrument from antiquity. It is founded already on the Cyclads around 2500 BC. It dissapeares a little time, but with the growing of Greek culture it comes back.
The origin is connected to a myth. You can read that in the 'Metamorphosis' of Ovidius. Pan, a god born with the paws of a goat, horns and a hairy upper part of the body badgered on the Olympus. He left this world and established hisself in Arcadie. He is the god of the forest, the open country and is in general associated with nature. In the woods, he did only 3 things: play on his flute, pick up girls and stomp with his feet to scare the people.
One day, he fell in love with the waternymph Syrinx. However, she did not want him and ran away from him. When she reached the river Ladon, which she couldn't cross, she begged Artemis that she would change here into something, because, falling in his hands was the last thing she wanted.
When Pan held her, he noticed he was holding reed. He sighed and this caused a magical and comforting sound out of the holes. To find comfort, he plucked some stalks, bound them together and called it Syrinx. Beautiful isn't it ? :-)
Still, in some stories, the pan-pipe is associated with Hermes (Cf. Homeric Hermes-hymne). But more and more, pan was associated with it. It became the instruments of the shepherds. Thats why it didn't get much appreciation by composers and intellectuals.
By blowing on the upper side, the air is vibrated in the tubes. The height of the tones depends on the lenght of the tube: the shorter the tube, the heigher the tune. In the early days, the tubes had an equal length and to tune the pan-pipes, one used wax.
One put wax in the tube until the tune was just right. It was also used to close scratches or little openings in the side. The inside was also rubbed with wax to get a smooth sound. Later, one made the tubes out of different lengths (CF; picture pan-pipe from Alesia). The notes of the pipes go from the lowest tone right, the highest one left. Strange, if we compare this with the piano, this is turned around.