How Learning Works: Components, Systems, and Loops