The computer will flag this code if it sees multiple misfires on different cylinders. The engine could be misfiring on two different cylinders or it could be misfiring on all cylinders causing a P0300 code in the computer.
There are many factors that will cause the engine to run rough and generate a diagnostic trouble code of P0300. In addition, different manufactures tend to have their own faults which can lead to the engine misfiring and cause the P0300 code in the computer. Sometimes your vehicle will run just fine but the computer can still store a P0300 code in the computer. A misfire will always fall into one of three categories. Spark, fuel or mechanical. Bad tune up parts or incorrect ignition timing will cause a misfire under the spark category. Low or no fuel pressure due to a bad fuel pump or fuel pump driver module, leaky or plugged injector or faulty fuel pressure regulator will fall under the fuel category. It could be a lack of fuel or it could be too much fuel. Tight valves, broken valve springs, worn valves, compression rings, broken camshaft or even incorrect valve timing falls under the mechanical category. All of these issues can cause a P0300 code in the computer.
Below is a video I made on a Oldsmobile 3.8 liter engine. I removed a spark plug wire and an injector clip in order to make the engine misfire and cause a P0300 code in the computer.