Tell us about yourself!
Great question! It is really there for safety and in an ideal world, probably won't need it. The other side of the Optocoupler is connected to GND (Pin #2 in diagram) and if you misconnected that and actually connected the ground pin to a higher voltage, then it might reverse. Internally it has a diode, which again, technically should not allow reverse flow. But dealing with components that are mass-manufactured in real-world, we don't always get best-case scenarios, so in this case, it was better to just add a cheap resistor than risk frying our Raspberry Pi.Hope that answered your question! :)