Higher chance of dementia might be caused by the genome or the lack of mental exercise, so it's not just food or unhealthy habits, rather an amalgamation of various factors.
In her case, retirement and being unmarried/socially isolated during COVID lockdowns obviously contributed to a more rapid progression in decline. But you would never say that social isolation causes Alzheimer's. There are many other people with active social lives and happy marriages who get early dementia. The same is almost certainly true with diet.