The system of apprenticeship first developed in the later Middle Ages and came to be supervised by craft guilds and town governments .
In the late Middle Ages the craft guilds and town governments used to watch and control the system .