From time to time floods may bury trees with silt. This will keep them away from the air and stop them from rotting. If this happens, liquids seeping through the silt will exchange for water and other substances in the tree. More or less all of the features of the tree remain, but they are no longer made of wood (which is based on carbon) but on stone (which is mainly made of silicon).
Because petrified wood is like a huge piece of silica (quartz) it is very tough, and so does not easily weather if it is exposed at the surface. That is why, in places where there are petrified forests, the trunks stand up out of the soft rocks, or remain lying on the surface.
The most common colour for petrified wood is red, although grey to yellow is also common.