Combustion occurs when oxygen and fuel mix within an environment (in the case of a car, that environment is within the engine) which is warm enough, and an ignition source if found. The ignition sources in a gas-powered piston engine are spark plugs. In a diesel engine, the ignition source is high pressure.
Combustion is a form of rapid oxidation, much like a fire, or an extremely high-speed rusting process. The energy from combustion comes from the rapid expansion pushing down on the pistons, not the actual burning of the fuel (which is why intercoolers are able to increase an engine's power output).