evergreen trees on the top of building construction?

Does any one know the reason and providence of the habit of putting an evergreen tree (and often a flag) on the top of new building construction? It seems to appear at a certain point in construction on the top floor, and though usually I have only seen it on building from scratch, so to speak, I recently saw it on a building where they were adding a floor to an existing structure. My web searches turned up nothing. Thanks.

Here ya go:

History of the “Topping Out” Ceremony via Columbia U.