To prevent catching on the bottom by stirring constantly
To know when to stop cooking, for that you need to do one of the folollowing:
Use a a thermometer, and stop when it reaches 80°C or 176°F
Remove the spatula from time to time and draw a line with your finger in the mixture adhering to it. If it lasts (as in the photograph), it is cooked; if not, continue.