If the code was P0305(misfire #5) that means the computer has detected cylinder #5 has been misfiring over a period of time.
Computer doesn't set a code for occasional misfires, misfire has to be repeated quite a few times to get a code.
Pulling out the second spark plug is just to compare it with #5 if they look the same then spark plug is probably not the problem.
The Computer doesn't have a clue about why a cylinder misfires.
On the front of the engine behind the lower pulley, is the Crank Position(CKP) Sensor.
It "reads" a wheel, on the crankshaft, with teeth on it, each time a tooth passes by the CKP sensor it sends a pulse to the computer.
This wheel has 1 missing tooth, the missing pulse tells computer when #1 cylinder's piston is at the top.
Since it knows when #1 is at the top it can tell when 2, 3, 4, 5, and 6 are also at the top, by counting the pulses.
If you are accelerating, the computer knows each cylinder that fires will increase the speed of the wheel/pulses by XX milliseconds.
If a cylinder doesn't fire, then it will be less than XX milliseconds, so no speed added
If you are just cruising along then each pulse will be X milliseconds apart, if there is a misfire then longer time gap, less power added.
If you are decelerating then it can't detect misfires.
So P0305 is just computer saying "heads up" #5 doesn't seem to be adding the same power as the other 5 cylinders.
No specific reason, could be spark, fuel or mechanical issue, it is just a "heads up"