This phrase originates in Cervantes' Don Quixote, or at least in Thomas Shelton's 1620 translation - Cervantes Saavedra's History of Don Quixote: "You are like what is said that the frying-pan said to the kettle, 'Avant, black-browes'." ( source ) The figurative meaning is that a criticism a person makes of another could equally well apply to themselves.