The invention relates to a composition for treating keratin materials, in particular the hair, comprising, in a physiologically and in particular a cosmetically acceptable medium, at least one protecting or conditioning agent, and also at least one cationic poly(alkyl)vinyllactam polymer. These combinations make it possible to improve the deposition of the agent for protecting or conditioning the keratin materials and also the cosmetic properties.