let's walk it backwards.
Top of motor is connected permanently to +6volts.
Motor will run whenever current is allowed to flow through it, from +6 to -6.
That is the purpose of the STP60xxxx... FET, to allow that conduction from motor bottom to -6 when commanded by Arduino.
Turning on that FET allows motor current to flow around the closed loop Supply+ > Motor > FET > Supply- . (Remember KCL)
Turning off that FET disallows motor current.
But you cannot instantly stop current through an inductor, and a motor has plenty of inductance.
The inductance will reverse the polarity of and raise voltage across its terminals to whatever is necessary to maintain current flow.
Diode 11DQ... gives that current someplace to flow when FET turns off. Current can decay to zero as it completes the closed loop around diode/motor. Observe clever connection of diode to provide correct polarity...
FET60NExx... is turned "on" by driving gate toward +6 volts through the transistor half of opto-isolator. That transistor turns "on" whenever Arduino provides "drive" current through LED half of opto-isolator.
The 100n capacitor across motor terminals is there to absorb electrical "noise" from arcing at the motor brushes.
Someday place a cheap transistor radio set for AM adjacent a small motor and listen for "static" when the motor runs. Motor brushes make RF interference, that's why you usually see a small capacitor very near the motor terminals. That RF "noise" can wreak havoc with computers so they suppress it as near the source as is practical.
Opto-isolator's transistor half has a small but non-zero "off state" current.
1K resistor across FET's Gate-source just assures that the off-state current through opto-isolator won't mistakenly turn on the FET. It can't produce enough voltage across just 1Kohm.That's all the parts.
By varying the fraction of time during which motor current is allowed to flow through FET60NE... and motor, you are controlling the average voltage impressed across the motor. That in turn will control its speed.
If you connect a tachometer to the motor and use that to apprise Mr Arduino of motor's speed, you can achieve very precise speed control.
Look up servo control... it's a whole 'nother field.Have fun
old jim