Excellent answers, and it is indicative of you guys doing your research.
The aldehydes and ketones form from the reaction of NOx with hydrocarbons at or above 137 C. These aldehydes and ketones undergo condensation to form polymeric compounds. These polymeric compounds further oxidize to form sticky oxygenates called 'resins."
This resin is a basic component to all precursors such as varnish, lacquer, carbon, and sludge.
Varnish, lacquer and carbon show up when resins separate out on hot surfaces and dehydrates . Carbon start to drop out of the resin when the resin is subjected to temps ranging from 300 C to 680 C.
At or below 200 C, such as the piston skirts, these deposits form a thin film of lacquer or varnish.
Lacquer is largely formed in Deisel engines from lubricant components. Lacquer froms on piston skirts, cylinder walls, and in the cooler parts of the combustion chamber.
In gasoline engines, Varnish is largely formed from fuel components. Varnish forms on valve covers, piston rings, piston skirts, valve lifters, and PCV components.
BTW, lacquer is water soluble and varnish is only acetone soluble.