Gasoline is a fuel mixture. High compression internal combustion engines place gasoline under great pressure. The pressure can cause the gasoline to ignite early (pre-ignition or detonation) causing a damaging knocking sound, also called "pinging" or "pinking".
Originally, organic compounds with lead were added to petrol to prevent knocking: tetraethyllead (TEL). This is now banned because the lead affects people's health. Various alternatives have been tried. 2,2,4-trimethylpentane, an isomer of octane, is one example.