I think that a large part of it can be when older people's worlds start to get very small. Their children are grown and have long left home, they're retired and don't have anything like as much structure to their lives.
Most older folk embrace this new-found freedom and find positive hobbies and interests, travelling and social/community pursuits - or just enjoy spending time with their families, sitting at home, enjoying their own company; reading, watching TV, social media, relaxing etc.
Unfortunately, for those who don't find good channels for their interests and energies, there's always the risk that they will seek to make other people into their entertaiment, almost constructing their own real-life soap operas - finding fault in passers-by and cavilling at the most pointless things. We have an elderly neighbour whose hobby is making enemies of the neighbours, mainly by harassing them over parking perfectly legally, safely and considerately where he thinks they 'shouldn't', even though he has a very big drive and it doesn't impact him in any way.
I think some older people also find it hard to adjust to how the world is going, with new technologies and social customs that they just can't understand. They can start to feel excluded and so cling on to sharing far and wide the 'wisdom' that they have; but not the positive wisdom of experience.
They may see a much younger person in good health, happy, confident and popular, with their life ahead of them; and feel jealous and resentful, so their automatic recourse is to fault-find and belittle in some way that seems important to them. In fact, apart from the 'life ahead of them', these kinds of people are not that dissimilar to school bullies.