Some levels have a key that unlocks a locked color. Unlocking happens after you free and match the key color.