I'm more up on hairs than feathers so I'll answer with respect to fur -
PFA Maderson in American Zoologist, 1972, suggests that mammalian hairs began as mechano-sensory organs and later gained sufficient density to function as insulation -
A chance mutation led to subsequent multiplication of the originally
sparsely, but spatially arranged papillae, causing the induction of a
sufficient density of "sensory hairs" to constitute an insulatory body
This is a function which has not been lost - it may be a defining characteristic of mammalian hairs that they act, via follicular nerves, as sensory organs. In humans the density of follicular nerve supply is especially high, enough for W.Montagna, "Evolution of Human Skin", 1985, to liken them, regardless of size or location, to the dedicated feeler hairs - vibrissae - of related apes - which makes the sensory function the principle one most of the hairs on modern humans serve. As I suggest they probably are the principle function of hairs of other "hairless" species like Hippopotamus, Elephants, Mole Rats - which, like humans, are not actually hairless.
A whole range of functions besides sensory became possible once hairs evolved, including insulation, water shedding, protection from direct sunlight and physical abrasion, visual signalling/communications and dispersal of pheromones. Mammals managed to evolve and use them all. Manes in lions are probably signalling (of male sexual maturity and sexual fitness) rather than protective.