These docs are about as high a level as is possible to fully explain the all the parts.
Because that is what you configured that Item to do.
The state of the Item is updated to match the state sent by the Sonoff. This keeps your Item in sync with the Sonoff if you press the button to toggle the switch.
With point 1 what I was meaning was when in the OH2 UI and I click a switch ON does OH look for an ON command in the items file. Is ON for want of a better word a reserved word. If not how does it distinguish between ON and OFF mqtt commands
You defined that command to use with your binding param command:ON.
ON command is send to the internal bus and received by mqtt binding, which gets respective instructions from your config.
The UI processes the mouse click and executes some JavaScript code.
The JavaScript code makes a REST API call to send the ON command to the Item that the UI element represents.
openHAB receives the command and changes the state of the Item
openHAB publishes the fact that the Item received an ON command on the Event Bus
a. The MQTT Binding (in this case) receives the fact that an Item with an MQTT config received an ON command
i. The MQTT Binding uses the Binding Config String on that Item to determine the broker, topic, transformation that needs to be applied, and whether or not it needs to publish a message in response to that ON command
b. The Rules engine triggers any Rules that are configured to trigger on a change, update, or command on that Item
c. The Persistence engine saves the state to the database if configured to do so.
d. I’m not sure on this one but the UIs may receive an event indicating the Item changed state based on this event.