it's mainly caused by the sugar, also, though some of the fusil oils of fermentation can be nasty, and these can cause reactions that are rooted in damage done to the liver
the second main cause of issues is dehydration, and secondary to that, electrolyte depletion
the last one is one that creeps up on you over years of drinking too much and you end up with tinnitis, cramps, vision problems, all kinds of vulnerabilities and reduced immunity, prone to fungal infections and many other very unpleasant things
it's not good for you, and that goes double for shitty wines with too much sugar in them (and port and other such abominations)