One example of a petrified fossil is ancient wood that has had all of its tissue replaced by quartz over a long period of time. Petrifaction occurs when a dead organism is protected from rot such that mineral-rich water is able to seep into it.
Petrifaction works by minerals becoming deposited in the organism's tissue as the tissue is slowly washed away. The minerals crystallize into the same shape as the tissue they replace. This results in fossils that can be very highly detailed, preserving structures down to the microscopic level. Most petrified fossils are not so complete, but the texture of bark and other small structures is often preserved.