In current fuel injected vehicles, the computer (ECU) adjusts for it. There are sensors in your engine called "knock sensors". When the sensors start picking up a knock, it will pull timing. Usually, timing is advanced where it sparks to fire the engine before the piston reaches top dead center of the compression stroke. This is the start of the power stroke. If the ECU picks up any knock or pinging, it will "pull timing", which means it won't fire the spark as soon, putting the piston closer to top dead center. The overall effect of this is, your engine will lose power. The more reduction in advance, the more power is lost.
The ECU does all of this automagically, but it can only pull so much timing before the engine will stop running correctly. The ECU will pull as much timing as it can prior to causing run issues, which then allows more knock to occur. If you are noticing knock while it's running, there's some seriously bad fuel in your vehicle, or there's other issues going on.
If your vehicle is in question, it is really important not to run the lower octane fuels. In boosted applications, knock can occur very quickly and very harshly under severe loads. It will get beyond the point for which the ECU can pull timing. Under these types of situations, damage can occur to your engine. Something which regularly occurs under these situations like this is for the ring lands of the pistons to bust due to the harsh conditions provided by the boost and knock together. This is an "engine rebuilding event", meaning, your engine will suffer catastrophic failure, and will most likely incur the need for replacement.