The engine is a machine that allows the stored chemical energy of gasoline to be transformed into mechanical energy that drives the wheels of the car. Energy is not always found in a convenient form, so many of man's inventions are designed to transform one type of energy to another. Below are a few examples of what I mean. Solar collectors can be used to transform solar energy into electrical energy. Wind mills make use of the kinetic energy of the air molecules, transforming it to mechanical or electrical energy.
Hydroelectric plants transform the kinetic energy of falling water into electrical energy.
Eventually the balls on the table stop moving. Well, energy is lost, but it is not destroyed. Some of the kinetic energy is transformed into various types of energy which the billiard balls can't make use of. A large amount of the kinetic energy is turned into heat energy because of the friction between each ball and the surface of the table.