I was also wondering about this. My mother's now in a care home and her mental condition is such that she might still know what an election is, but she's no longer able to make an appropriate sort of response.
It worries me that she must be one of many who no longer have the mental capacity to vote but who remain on the electoral register. It strikes me as an area where things are being fudged.
In other contexts (regarding her health and care), we've had to argue that she no longer has mental capacity, but on this, it doesn't seem to be deemed relevant! Back in the days when my mother was still living in her own home, we got counci tax exemption - on the basis of her mental health! It seems to be one set of rules for one thing, another set of rules for others.