History of philosophy

A person notices that they are comparing two ideas and then forms an idea of comparing. In Locke's terminology, what is the immediate source of this latter idea?