How does the principle of conservation of energy apply to the functioning of an internal combustion engine, and what are the key components involved in this process?